如何为我们的 java 应用程序使用 Java Service Wrapper
我正在尝试在我的应用程序中实现调度程序。我使用弹簧和石英支撑。 我已经测试了我的组件并完美运行。
我的主要方法是:
public class Main {
public static void main(String[] args) {
new ClassPathXmlApplicationContext("application-context.xml");
}
}
我使用wrapper-windows-x86-32-3.5.7,配置wrapper.conf,并使用DemoApp.bat包装器从控制台运行。 有用。
但是当我想安装该服务时,我收到错误消息启动失败:等待来自 JVM 的信号超时。
重复 5 次后,我收到错误消息
JVM did not exit on request, returned
连续启动失败 5 次,每次持续时间不到 300 秒。放弃。
感谢您的帮助。
I'm trying to implement scheduler to my application. I use spring and quartz support.
I have test my component and run perfectly.
My Main method is:
public class Main {
public static void main(String[] args) {
new ClassPathXmlApplicationContext("application-context.xml");
}
}
I use wrapper-windows-x86-32-3.5.7, I configure the wrapper.conf, and run from console using DemoApp.bat wrapper.
It works.
But When I want to install the service, I got error message Startup failed: Timed out waiting for a signal from the JVM.
After 5 times repetition, I got error message
JVM did not exit on request, terminated
There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
Thanks for help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为它适合在控制台中运行,但不能作为服务运行。这很可能是 SYSTEM 用户的环境问题。最常见的原因是无法找到 java 二进制文件。如果您查看wrapper.log 文件,原因应该相当明显。
java 二进制文件的默认位置是:
包装器.java.command=java
这将导致它在 PATH 中找到。要使用 JAVA_HOME 位置,请尝试以下操作:
wrapper.java.command=%JAVA_HOME%/bin/java
然后确保您已将 JAVA_HOME 变量声明为系统范围变量,而不是当前用户帐户的变量。
干杯,
莱夫
Because it is working fine for you running in a console, but not as a service. This is most likely a problem with the environment of the SYSTEM user. The most common cause is not being able to locate the java binary. The cause should be fairly obvious if you look in the wrapper.log file.
The default location of the java binary is:
wrapper.java.command=java
This will cause it to be found on the PATH. To use a JAVA_HOME location, try the following:
wrapper.java.command=%JAVA_HOME%/bin/java
Then make sure you have declared the JAVA_HOME variable as a SYSTEM WIDE variable, not jsut for your current user account.
Cheers,
Leif