连接拒绝错误Java / Linux

时间:2013-03-07 09:17:30

标签: java linux sockets port

我试图将现有项目移到新的(linux)服务器环境中(注意,我没有直接访问代码,也没有关于该项目的任何知识 - 谈论一个伟大的开始),在启动项目时,我收到以下错误:

Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: <servername>:1459 [Root exception is javax.naming.CommunicationException: Failed to connect to server <servername>:1459 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server <servername>:1459 [Root exception is java.net.ConnectException:     Connection refused]]]
    at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at org.jboss.Shutdown.main(Shutdown.java:214)
Caused by: javax.naming.CommunicationException: Failed to connect to server <servername> [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server <servername>:1459 [Root exception is java.net.ConnectException: Connection refused]]
    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
    at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
    ... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server <servername>:1459 [Root exception is java.net.ConnectException: Connection refused]
    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
    ... 5 more
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:276)
    at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
    at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
    at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
    ... 5 more

现在,我打开了有问题的端口,看看是否有任何变化,唉,没有任何反应。

对于这个非常模糊的信息水平我感到抱歉,但我真的只有这一点,如果你有任何想法,我很乐意提供我能做到的事情。

此致

丹尼斯

1 个答案:

答案 0 :(得分:1)

Connection refused是您尝试将connect TCP / IP套接字发送到不存在的服务时出现的错误。

通常,这意味着建立连接的计算机实际上能够到达远程服务器,但是没有服务正在侦听指定的端口。

这不太可能是网络配置问题。如果端口被阻止,您通常只是看到超时,或者在某些防火墙上发现connection reset by peer错误。