美文网首页spring boot问题集
spring boot 运行错误(一)

spring boot 运行错误(一)

作者: zl520k | 来源:发表于2019-09-30 17:26 被阅读0次

No active profile set, falling back to default profiles: default

Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationProperty': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'application.name' in value "${application.name}"

由于没有在application.yml中

spring:

profiles:       

       active: prod

这样就解决了这个问题。

还有要在pom.xml文件添加如下:

在build这个目录下增加如下两个:

<finalName>springbootdemoproperties</finalName>

<resource>

   <resource>

              <directory>src/main/resources

             <filtering>true</filtering>

   </resource>

<resource>

不然也会出现以上这个错误。

相关文章

网友评论

    本文标题:spring boot 运行错误(一)

    本文链接:https://www.haomeiwen.com/subject/ralhpctx.html