spring boot问题集

spring boot 运行错误(一)

2019-09-30  本文已影响0人  zl520k

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>

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

上一篇 下一篇

猜你喜欢

热点阅读