当前位置: 技术问答>java相关
我的Tomcat怎么不能停止和重启呀????清高手指点一二
来源: 互联网 发布时间:2017-04-08
本文导语: 我的Tomcat是启动Windows2000时自动启动的。 我现在想停止Tomcat的服务, 可是我执行了Start->Apache Tomcat 4.1->Stop Tomcat后却显示了很多出错信息。 我也没看清楚,于是就在DOS控制台上输入: C:j2sdk14binjava.exe -jar -Duser.dir="...
我的Tomcat是启动Windows2000时自动启动的。
我现在想停止Tomcat的服务,
可是我执行了Start->Apache Tomcat 4.1->Stop Tomcat后却显示了很多出错信息。
我也没看清楚,于是就在DOS控制台上输入:
C:j2sdk14binjava.exe -jar -Duser.dir="C:Tomcat 4112" "C:Tomcat 4112binbootstrap.jar" stop
(Stop Tomcat快捷方式里的目标)
系统提示出错了,内容如下:
Catalina.stop: java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.(Socket.java:291)
at java.net.Socket.(Socket.java:119)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:579)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
这是什么地方出了错误呢?
我该怎么改正才能顺利的停止掉Tomcat的服务呢?
我直接执行Start Tomcat快捷方式里的目标,也出错了!
信息是:
2002-12-18 14:15:39 org.apache.commons.modeler.Registry loadRegistry
信息: Loading registry information
2002-12-18 14:15:40 org.apache.commons.modeler.Registry getRegistry
信息: Creating new Registry instance
2002-12-18 14:15:40 org.apache.commons.modeler.Registry getServer
信息: Creating MBeanServer
2002-12-18 14:15:41 org.apache.coyote.http11.Http11Protocol init
严重: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoi
nt.java:268)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150)
at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.
java:1002)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:579)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:2245)
at org.apache.catalina.startup.Catalina.start(Catalina.java:509)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.start: LifecycleException: Protocol handler initialization failed: jav
a.net.BindException: Address already in use: JVM_Bind:8080
LifecycleException: Protocol handler initialization failed: java.net.BindExcept
ion: Address already in use: JVM_Bind:8080
at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.
java:1004)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:579)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:2245)
at org.apache.catalina.startup.Catalina.start(Catalina.java:509)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.stop: LifecycleException: This server has not yet been started
LifecycleException: This server has not yet been started
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2212
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:541)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
这又是咋了呢?
我现在想停止Tomcat的服务,
可是我执行了Start->Apache Tomcat 4.1->Stop Tomcat后却显示了很多出错信息。
我也没看清楚,于是就在DOS控制台上输入:
C:j2sdk14binjava.exe -jar -Duser.dir="C:Tomcat 4112" "C:Tomcat 4112binbootstrap.jar" stop
(Stop Tomcat快捷方式里的目标)
系统提示出错了,内容如下:
Catalina.stop: java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.(Socket.java:291)
at java.net.Socket.(Socket.java:119)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:579)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
这是什么地方出了错误呢?
我该怎么改正才能顺利的停止掉Tomcat的服务呢?
我直接执行Start Tomcat快捷方式里的目标,也出错了!
信息是:
2002-12-18 14:15:39 org.apache.commons.modeler.Registry loadRegistry
信息: Loading registry information
2002-12-18 14:15:40 org.apache.commons.modeler.Registry getRegistry
信息: Creating new Registry instance
2002-12-18 14:15:40 org.apache.commons.modeler.Registry getServer
信息: Creating MBeanServer
2002-12-18 14:15:41 org.apache.coyote.http11.Http11Protocol init
严重: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoi
nt.java:268)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150)
at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.
java:1002)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:579)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:2245)
at org.apache.catalina.startup.Catalina.start(Catalina.java:509)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.start: LifecycleException: Protocol handler initialization failed: jav
a.net.BindException: Address already in use: JVM_Bind:8080
LifecycleException: Protocol handler initialization failed: java.net.BindExcept
ion: Address already in use: JVM_Bind:8080
at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.
java:1004)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:579)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:2245)
at org.apache.catalina.startup.Catalina.start(Catalina.java:509)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.stop: LifecycleException: This server has not yet been started
LifecycleException: This server has not yet been started
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2212
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:541)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
这又是咋了呢?
|
没错,如果是作为服务启动的,只有到服务中停止该tomcat服务才行。
stop的快捷方式只能关掉利用start快捷方式启动的tomcat!
因为好像只有利用start快捷方式启动的tomcat才会监听8005(server.xml中设置)端口,在这种方式下,你还可以通过telnet SERVERIP 8005,然后输入SHUTDOWN来关闭tomcat,这也就是tomcat的stop快捷方式的原理.......
stop的快捷方式只能关掉利用start快捷方式启动的tomcat!
因为好像只有利用start快捷方式启动的tomcat才会监听8005(server.xml中设置)端口,在这种方式下,你还可以通过telnet SERVERIP 8005,然后输入SHUTDOWN来关闭tomcat,这也就是tomcat的stop快捷方式的原理.......
|
管理工具->服务中停止Tomcat,改Tomcat启动方式为手动
|
tomcat作为服务随系统自动启动不能用快捷方式停止服务。
|
更方便的方法是用命令行启动和停止服务:
net start|stop 服务名
net start|stop 服务名
|
你输入 http://127.0.0.1:8080 就可以看到了工作的tomcat
其它的原因上面都说了,改为手动启动的就好了
其它的原因上面都说了,改为手动启动的就好了
|
TO:villagehead (村长)
我也碰到过相似的问题,按照上面的各位高手将服务中的“Apache Tomcat”选项的启动方式改为手动后就可以了!
我也碰到过相似的问题,按照上面的各位高手将服务中的“Apache Tomcat”选项的启动方式改为手动后就可以了!