Posted by:waya
Posted on:2006-05-10 17:15
已经运行tomcat 5.5
然后java程序里面的代码如下:
System.out.println("Connect it to the RMI connector server");
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:8080/Catalina");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
运行java程序错误如下:
Create an RMI connector client and connect it to the RMI connector server
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.io.EOFException]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:31
7)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFacto
ry.java:248)
at Server.main(Server.java:45)
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.io.EOFException] at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java
:92)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.j
ava:185)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1807)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.j
ava:1777)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:25
9)
请教各位大侠这是怎么回事,非常感谢