指定的服务不存在为已安装的服务

use*_*026 2 tomcat

我从tomcat收到此错误:

The specified service does not exist as an installed service.
Unable to open the service “tomcat8”
Run Code Online (Sandbox Code Playgroud)

这样应用程序将根本无法启动,

所以我打开命令行并安装了服务:

    tomcat8.exe //IS//tomcat_8_ServiceName    
Run Code Online (Sandbox Code Playgroud)

但是仍然面临着同样的问题
假设我在同一个盒子上有多个
tomcat,exe文件tomcat8w.exe从哪里获取服务名称?

打印屏幕:

use*_*026 6

经过几个小时的努力,我使用Service安装程序安装了新的tomcat,以查看其功能,显然安装程序更改了可执行文件.exe的名称以使其与服务名称匹配。

所以如果你跑

 tomcat8w.exe  
Run Code Online (Sandbox Code Playgroud)

它将查找服务名称:tomcat8

因此,我回到了旧的tomcat目录,并使用以下命令安装了该服务:

 tomcat8.exe //IS//tomcat_8_ServiceName  
Run Code Online (Sandbox Code Playgroud)

我将可执行文件从tomcat8w.exe重命名为tomcat_8_ServiceNamew.exe

现在它的工作就像一种魅力!


hel*_*rth 5

请注意,使用位于 bin 目录中的 service.bat 脚本将 Tomcat 安装为服务更容易(JVM 参数等是自动添加的,这不是使用 tomcat7.exe //IS//xx 完成的)。如果你使用它,至少对于 Tomcat 7,就像我的情况一样,你可以使用命令

service.bat install myService
Run Code Online (Sandbox Code Playgroud)

创建的服务名为“Apache Tomcat myService”,然后可以使用 tomcat7w 对其进行编辑,如下所示:

tomcat7w.exe //ES//myService
Run Code Online (Sandbox Code Playgroud)

即以下内容将不起作用并产生上述错误:

tomcat7w.exe //ES//"Apache Tomcat myService"
Run Code Online (Sandbox Code Playgroud)