windows Jboss 服务启动然后停止
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3723107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jboss Service started and then stopped
提问by user408305
I'm attempting to get my Jboss Server running as a windows service using the JbossService.exe, and I had it working until I uninstalled it (with ./JbossService -uninstall JbossService), and now, while it will install and the service will appear in the windows service list, attempting to start it will only yield the error message:
我正在尝试使用 JbossService.exe 将我的 Jboss 服务器作为 Windows 服务运行,并且我一直在运行直到我卸载它(使用 ./JbossService -uninstall JbossService),现在,虽然它将安装并且服务将出现在 windows 服务列表中,尝试启动它只会产生错误消息:
"The JBossService on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
“本地计算机上的 JBossService 启动然后停止。某些服务如果没有工作会自动停止,例如性能日志和警报服务。”
If it helps, the command I'm using to install it is:
如果有帮助,我用来安装它的命令是:
./JBossService.exe -install JBossService "$java_home\jre\bin\server\jvm.dll"
-Xmx128m -Xrs -Djava.class.path="$java_home\lib\tools.jar;$jboss_home\bin\run.jar"
-Duser.timezone="Australia/Sydney"
-start "org.jboss.Main" -stop "org.jboss.Main"
-method systemExit -out "$jboss_home\server\default\log\stdout.log"
-err "$jboss_home\server\default\log\stderr.log"
-current "$jboss_home\bin"
Any ideas would be appreciated. If more information is required just let me know.
任何想法,将不胜感激。如果需要更多信息,请告诉我。
采纳答案by Matt Solnit
Are you using Cygwin? If not, this could be due to the fact that environment variables are referenced using %%
, not $
, on Windows. You might try the following instead:
你在使用 Cygwin 吗?如果不是,这可能是因为在 Windows 上使用%%
而非来引用环境变量$
。您可以尝试以下方法:
JBossService.exe -install JBossService "%java_home%\jre\bin\server\jvm.dll"
-Xmx128m -Xrs -Djava.class.path="%java_home%\lib\tools.jar;%jboss_home%\bin\run.jar"
-Duser.timezone="Australia/Sydney"
-start "org.jboss.Main" -stop "org.jboss.Main"
-method systemExit -out "%jboss_home%\server\default\log\stdout.log"
-err "%jboss_home%\server\default\log\stderr.log"
-current "%jboss_home%\bin"
Even if you are using Cygwin, the $
notation still might not work if, for example, these parameters are being stored in the Registry and then read later from the OS (which does not understand Cygwin notation).
即使您使用的是 Cygwin,$
例如,如果这些参数存储在注册表中,然后从操作系统(它不理解 Cygwin 符号)读取,则符号可能仍然不起作用。
回答by JoshDM
While this does have a valid answer, one reason this happened to me recently is because the user the JBoss Windows Service was running as had certain active directory permissions revoked from the server (in this case, administrative-like permissions); it could no longer access certain directories it required in order to process (the Java bin folder, for example).
虽然这确实有一个有效的答案,但最近发生在我身上的一个原因是因为运行 JBoss Windows 服务的用户从服务器撤销了某些活动目录权限(在这种情况下,类似于管理权限);它无法再访问处理所需的某些目录(例如,Java bin 文件夹)。
Once the user the service ran as was added back to the appropriate Windows User Groups, the JBoss Windows Service started with no issues.
一旦服务运行的用户被添加回适当的 Windows 用户组,JBoss Windows 服务就可以正常启动。
回答by Aniket W
In my case, JAVA_HOME was not set. Once I did that, Automatically windows Services started. :)
就我而言,未设置 JAVA_HOME。一旦我这样做了,Windows 服务就会自动启动。:)