Java-无法在Windows中将Tomcat 7作为服务安装
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Java-无法在Windows中将Tomcat 7作为服务安装,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1921字,纯文字阅读大概需要3分钟。
内容图文
![Java-无法在Windows中将Tomcat 7作为服务安装](/upload/InfoBanner/zyjiaocheng/947/9bb5bd0addaa4f21b4e4b1904f18cef6.jpg)
我正在尝试将tomcat作为服务安装在Windows Server 2008中.
我在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位,并且我同时使用tomcat 32和64位进行了测试,两者都存在相同的问题.我也尝试过以管理员权限打开cmd.exe,但我遇到了同样的问题…
谢谢你的帮助
仅供参考:如果我使用startup.bat手动启动tomcat,它将正确启动
解决方法:
我解决了它,只需使用其他方法安装服务即可:
service.bat install
此命令将卸载服务:
service.bat uninstall
此外,要启动它并启用自动启动,还必须进入Windows的服务管理器(西班牙语版本的Servicios)并启动该服务并启用自动启动.
如果您可以在tomcat / bin目录中找到service.bat文件,请阅读以下内容:
apache-tomcat-[version].zip or .tar.gz
Base distribution. These distributions do not include the Windows service wrapper nor the compiled APR/native library for Windows.
apache-tomcat-[version]-windows-x86.zip
32-bit Windows specific distribution that includes the Windows service wrapper and the compiled APR/native library for use with 32-bit JVMs on both 32 and 64 bit Windows platforms.
apache-tomcat-[version]-windows-x64.zip
64-bit Windows specific distribution that includes the Windows service wrapper and the compiled APR/native library for use with 64-bit JVMs on x64 Windows platforms.
内容总结
以上是互联网集市为您收集整理的Java-无法在Windows中将Tomcat 7作为服务安装全部内容,希望文章能够帮你解决Java-无法在Windows中将Tomcat 7作为服务安装所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。