【发布时间】:2015-12-04 02:47:55
【问题描述】:
我正在尝试在 Windows Server 2008 中将 tomcat 作为服务安装。
我在stackoverflow中搜索并找不到这个问题的任何答案,我可以看到其他相关的问题,它们都不相同(与代码错误0有关,我的是代码错误1) 或没有有效的答案,所以我决定创建这个问题。
我正在使用它来创建服务:
https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services
tomcat7 //IS//Tomcat7 --DisplayName="Apache Tomcat 7" \
命令后,我可以在我的服务列表中看到 Apache Tomcat 7 服务,问题是它已停止,如果我尝试启动它,我会看到此错误:
Windows could not start the Apache Tomcat 7 on Local Computer. For
more information, review the System Event Log. If this is a
non-Microsoft service, contact the service vendor, and refer to
service-specific error code 1.
在系统事件查看器中,我可以看到此错误的日志:
The Apache Tomcat 7 service terminated with service-specific error Incorrect function..
我正在使用 java 64 位,并且我使用 32 位和 64 位的 tomcat 进行了测试,两者都有同样的问题。我也尝试使用管理员权限打开 cmd.exe,但我遇到了同样的问题...
感谢您的帮助
仅供参考:如果我使用 startup.bat 手动启动 tomcat,它会正确启动
【问题讨论】:
-
您可以在
HKLM\SYSTEM\CurrentControlSet\Services\Apache Tomcat 7检查您的注册表吗?有子键吗? -
它被称为 Services\Tomcat7 而不是 Apache Tomcat 7,它有很多子键
-
是的,对不起名字。有
Parameters子键吗? -
它是一个名为 parameters 的子目录,具有未指定值的 REG_SZ 类型
标签: java windows apache tomcat windows-services