spring boot 运行错误(一)

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>

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容