使用Java Service Wrapper能够把java程序注冊为一个系统服务,可是在启动服务的某些情况下会抛出例如以下错误:
ERROR | wrapper | 2014/06/11 08:48:54 | Startup failed: Timed out waiting for signal from JVM.
ERROR | wrapper | 2014/06/11 08:48:54 | JVM did not exit on request, terminated
FATAL | wrapper | 2014/06/11 08:48:54 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2014/06/11 08:48:54 | There may be a configuration problem: please check the logs.
STATUS | wrapper | 2014/06/11 08:48:54 | <-- Wrapper Stopped
启动失败,从jvm获得信号超时了,去官网查找配置文件:
http://wrapper.tanukisoftware.com/doc/english/prop-startup-timeout.html
http://wrapper.tanukisoftware.com/doc/english/prop-ping-timeout.html
能够改动wrapper的配置文件(conf / wrapper.conf)。设置启动超时时间:
#设置超时时间为2小时wrapper.startup.timeout=7200
#设置心跳超时时间为1小时wrapper.ping.timeout=3600
加入配置后,又一次启动windows服务。不再超时报错导致服务启动失败了。