《Spring Boot实战》示例代码问题

* Idea环境

* 《Java EE开发的颠覆者 Spring Boot实战》

1、2.2 Spring EL

读取文件获取不到:

需把test.txt和test.properties放在resource文件下,将resource文件标记为资源目录,将引用目录换为"classpath:test.txt"就可以。

2、 2.4  Profile

运行报错:GenericApplicationContext does not support multiple refresh attempts. 不允许多次刷新context。

需要在idea里修改Environment variable,设置spring.profiles.active=prod或dev启动,注掉修改context相关的三行代码即可。

猜你喜欢

转载自www.cnblogs.com/cachedking/p/9503405.html
今日推荐