2
開始自定義JMX服務器我使用下面的代碼開始我們的JMX服務器:錯誤的0.0.0.0
Integer port = 8291;
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://0.0.0.0:"+ (port+100) +"/jndi/rmi://0.0.0.0:"+ port +"/jmxrmi");
在我們的應用程序啓動時,我們正在:
Caused by: java.rmi.ConnectException: Connection refused to host: 0.0.0.0; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:120)
... 53 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:193)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterS
這個工作在Windows,但在Linux上失敗。 8291沒有任何約束(我通過netstat -anp
驗證了這一點)
有人知道爲什麼這是失敗嗎?
僅供參考。我們開始是因爲防火牆的自定義JMX服務器(見here用於解釋爲什麼)
不確定這是否對您有幫助,但我的linux機器上有相同的結果。 – 2011-02-15 22:34:45
但是它也會在MS Windows 2003 Server上失敗,這與您的體驗不同。 – 2011-02-15 22:44:48