[英]spring-boot application startup failure
I have been working on a long-time spring-boot project. 我一直在从事长期的spring-boot项目。 As of last week, the project started failing to execute. 从上周开始,该项目开始无法执行。 The initial error Banner$Mode
has been fixed by updating starter parent version. 通过更新入门级父版本,已修复了初始错误Banner$Mode
。 However now I am getting 但是现在我越来越
Injection of autowired dependencies failed; nested exception is
java.lang.IllegalArgumentException: Could not resolve placeholder
'account.name' in value "${account.name}"
In this case, although I run the application with a profile, I see in the console output 在这种情况下,尽管我使用配置文件运行应用程序,但我在控制台输出中看到了
INFO [AccountApp] No active profile set, falling back to default profiles: default
(I am posting everythng that is spring related) (我正在发布与春季有关的一切)
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<jackson.version>2.9.0</jackson.version>
<projversion>1.0</projversion>
<buildnumber>undefined</buildnumber>
<buildclassifier></buildclassifier>
</properties>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring-boot.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>1.5.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.10.RELEASE</version>
</dependency>
At this point it is essential to state that besides the pom, all the configuration and the application start worked smoothly. 在这一点上,必须声明,除了pom之外,所有配置和应用程序都可以顺利启动。 That's why I focused on a dependency based approach. 这就是为什么我专注于基于依赖的方法的原因。
Many thanks in advance 提前谢谢了
Thanks for the comments. 感谢您的评论。 It turns out the update from spring-boot
from 1.2.5
to 1.5.6
also includes a syntax change for application properties, meaning the ${account.name}
variable has to be declared as @account.name@
Application started running smoothly after this change. 事实证明,从1.2.5
到1.5.6
spring-boot
更新还包括应用程序属性的语法更改,这意味着必须将${account.name}
变量声明为@account.name@
这个变化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.