|-----[2020-03-12 22:04:20,958][ERROR][][][][Thread-][o.j.a.c.management-operation][]
JBAS013412: Timeout after [%d] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was %s at address %s
Application failed to start with classpath: [file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/charsets.jar, file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/deploy.jar, file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/ext/access-bridge-64.jar, file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/ext/cldrdata.jar, file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/ext/dnsns.jar, file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/ext/jaccess.jar, file:/C:/Program%20Files/Java/jdk1.8.0_65/jre/lib/ext/jfxrt.jar, file:/C:/Program%20Files/Java/jdk1.8
环境信息,jboss eap 7.1, spring boot 1.5.7.RELEASE,引入logback, logback中配置动态参数 ${app.config.path}/config.properties", 启动工程, 报错如上。经过多方调查,发现问题在logback配置,logback.xml片段代码如下:
<property name="app.config.path" value="config" />
<property file="${app.config.path}/test.properties" />
启动工程时,指定了动态参数
a
p
p
.
c
o
n
f
i
g
.
p
a
t
h
的
位
置
为
指
定
的
路
径
(
/
o
p
t
/
a
p
p
/
c
o
n
f
i
g
)
下
,
但
是
启
动
s
p
r
i
n
g
b
o
o
t
过
程
中
,
执
行
到
l
o
g
b
a
c
k
时
,
l
o
g
b
a
c
k
将
a
p
p
.
c
o
n
f
i
g
.
p
a
t
h
的
动
态
参
数
改
为
了
c
o
n
f
i
g
,
导
致
s
p
r
i
n
g
b
o
o
t
启
动
失
败
,
但
是
服
务
没
有
立
刻
s
h
u
t
d
o
w
,
也
没
有
有
用
的
日
志
信
息
进
行
排
查
,
导
致
问
题
很
无
头
绪
。
这
是
由
于
s
p
r
i
n
g
b
o
o
t
s
p
r
i
n
g
b
o
o
t
1.5.7.
R
E
L
E
A
S
E
代
码
不
够
完
善
,
在
s
p
r
i
n
g
b
o
o
t
1.5.9.
R
E
L
E
A
S
E
中
,
日
志
开
启
d
e
b
u
g
模
式
,
是
能
比
较
准
确
的
体
现
出
程
序
启
动
失
败
是
因
为
找
不
到
t
e
s
t
.
p
r
o
p
e
r
t
i
e
s
配
置
文
件
导
致
的
,
而
且
有
体
现
出
路
径
为
c
o
n
f
i
g
/
t
e
s
t
.
p
r
o
p
e
r
t
i
e
s
,
这
样
我
们
很
容
易
能
够
想
到
{app.config.path}的位置为指定的路径(/opt/app/config)下,但是启动spring boot过程中,执行到logback时,logback将app.config.path的动态参数改为了config, 导致spring boot启动失败,但是服务没有立刻shutdow,也没有有用的日志信息进行排查,导致问题很无头绪。这是由于spring boot spring boot 1.5.7.RELEASE代码不够完善, 在 spring boot 1.5.9.RELEASE中,日志开启debug模式,是能比较准确的体现出程序启动失败是因为找不到test.properties配置文件导致的,而且有体现出路径为config/test.properties, 这样我们很容易能够想到
app.config.path的位置为指定的路径(/opt/app/config)下,但是启动springboot过程中,执行到logback时,logback将app.config.path的动态参数改为了config,导致springboot启动失败,但是服务没有立刻shutdow,也没有有用的日志信息进行排查,导致问题很无头绪。这是由于springbootspringboot1.5.7.RELEASE代码不够完善,在springboot1.5.9.RELEASE中,日志开启debug模式,是能比较准确的体现出程序启动失败是因为找不到test.properties配置文件导致的,而且有体现出路径为config/test.properties,这样我们很容易能够想到{app.config.path}这个动态参数是在启动之后又被程序修改了,导致找不到文件而报错。
找到原因,问题就好解决了,去掉 这个配置,仅仅在启动时配置,或者更改
a
p
p
.
c
o
n
f
i
g
.
p
a
t
h
为
{app.config.path}为
app.config.path为{app.logback.path},再指定启动参数到指定路径下即可(-Dapp.logback.path = /opt/app/config)。
解决了困惑了许久的问题,开心,希望能帮到遇到同样问题的你。