本文介绍了JBoss 服务器连接在 localhost:1099 上被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在远程服务器上运行的 JBoss 5.0.1 GA 实例.服务器尝试启动位于同一实例上的批处理服务,但报告连接被拒绝.我发现一些网页说要将本地主机地址添加到 jndi.properties,但随后服务器无法启动.错误代码:

10:27:23,831 DEBUG [TimedSocketFactory] ​​createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 010:27:23,831 DEBUG [NamingContext] 无法连接到 localhost:1099javax.naming.CommunicationException: 无法连接到服务器 localhost/127.0.0.1:1099 [Root 异常是 javax.naming.ServiceUnavailableException:无法连接到服务器 localhost/127.0.0.1:1099 [Root 异常是 java.net.ConnectException:连接被拒绝]]

我运行命令

netstat -anpt

并且列表包含此服务器的 IP 和端口 1099.

我运行

telnet [服务器的 IP] 8080

并且它连接成功.

我运行

telnet [服务器 IP] 1099

并返回连接被拒绝和一些奇怪的字符.

对此有何想法?谢谢

解决方案
  1. 通过 ssh 登录服务器,然后从该服务器上的终端执行下一步操作.
  2. 运行netstat -anpt |grep 1099
  3. 检查 1099 端口的状态为 LISTEN.记住程序名和pid(netstat的最后一列输出,应该类似于5812/java)
  4. 尝试调查一下,是什么程序使用了它.运行 ps aux |grep xxxx 其中 xxxx - 来自步骤 3 的 pid
  5. 检查程序参数并确保它是 Jboss 实例.
  6. 检查 iptables 设置,确保允许从本地主机连接到 1099(默认情况下应该是这样)
  7. 尝试连接到端口 1099
  8. 如果可能,暂时禁用 iptables.
  9. 尝试连接到端口 1099
  10. 检查代理设置,也许你通过代理访问本地主机.

I have an instance of JBoss 5.0.1 GA running on a remote server. The server attempts to start a batch service located on the same instance, but it reports connection refused. I found some webpage that said to add the localhost address to jndi.properties, but then the server fails to start altogether. The error code:

10:27:23,831 DEBUG [TimedSocketFactory] createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
10:27:23,831 DEBUG [NamingContext] Failed to connect to localhost:1099
javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException:
Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]

I run the command

netstat -anpt

and the list contains the IP of this server and port 1099.

I run

telnet [IP of server] 8080

and it connects successfully.

I run

telnet [IP of server] 1099

and it returns connection refused and some weird characters.

Any ideas on what to do about this? Thanks

解决方案
  1. Log in into server via ssh and do next actions from terminal on this server.
  2. Run netstat -anpt | grep 1099
  3. Check state of 1099 port is LISTEN. Remember program name and pid ( last column output of netstat, should be something like 5812/java)
  4. Try investigate, what program used it. Run ps aux | grep xxxx where xxxx - pid from step 3
  5. Check program arguments and be sure it is Jboss instance.
  6. Check iptables settings, be sure incoming connection to 1099 is allowed from localhost ( it should be by default)
  7. try connect to port 1099
  8. Temporally disable iptables, if it possible.
  9. try connect to port 1099
  10. Check proxy settings, maybe you go to localhost through proxy.

这篇关于JBoss 服务器连接在 localhost:1099 上被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 06:01