81,094
社区成员
发帖
与我相关
我的任务
分享
2019-06-10 21:40:28.576 WARN 24080 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: o
rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.Illeg
alArgumentException: Could not resolve placeholder 'app.inside.description' in value "${app.inside.description}"
2019-06-10 21:40:28.579 INFO 24080 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-06-10 21:40:28.587 INFO 24080 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-10 21:40:28.591 ERROR 24080 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.Ille
galArgumentException: Could not resolve placeholder 'app.inside.description' in value "${app.inside.description}"
server.servlet.context-path=/zpl
server.port=8011
app.inside.description=${app.description} + this is inside2
app.description=this is inside
这是放在F盘目录的application.properties:
server.port=8088
app.description=this is outside
这是一个非常简单的controller
package springboot01.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@Value("${app.inside.description}")
private String msg;
@RequestMapping("/hello")
public String hello(){
return msg;
}
}