Apache Tomcat:java.net.ConnectException:连接被拒绝 [英] Apache Tomcat :java.net.ConnectException: Connection refused

查看:60
本文介绍了Apache Tomcat:java.net.ConnectException:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试停止 tomcat 服务器时,它给出了这样的错误.

while i try to stop tomcat server its giving an error like this.

[root@server classes]# service tomcat restart
Stopping Tomcat service:  Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:       /usr
Apr 17, 2011 10:11:53 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: 
java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:381)
    at java.net.Socket.connect(Socket.java:537)
    at java.net.Socket.connect(Socket.java:487)
    at java.net.Socket.<init>(Socket.java:384)
    at java.net.Socket.<init>(Socket.java:198)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:421)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
                                                           [  OK  ]

Starting Tomcat service: Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:       /usr

谁能帮我解决这个问题?

Can anyone help me to fix this problem?

推荐答案

在尝试解决这个问题的过程中,我看到了很多不恰当的答案.普遍的反应是您正在尝试停止尚未启动的程序"或其他程序正在您需要的端口上运行".

I've seen a lot of inadequate answers while trying to figure this one out. General response has been "you are trying to stop something that hasn't started" or "some other program is running on the port you need".

我的问题原来是我的防火墙.我什至没有考虑过这个,但是端口 8005(用于关闭的端口,感谢 Mindas)被阻止了.我改变了它,现在,没有更多的错误.祝你好运.

The problem for me turned out to be my firewall. I hadn't even considered this, but port 8005 (the port used for shutdown, thanks mindas), was blocked. I changed it, and now, no more error. Good luck.

这篇关于Apache Tomcat:java.net.ConnectException:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆