java用JMX远程监控客户端的一个练习报错: 10
Exceptioninthread"main"java.io.IOException:FailedtoretrieveRMIServerstub:javax.naming...
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:227)
at cn.com.agree.monitor.RMIClientTest.main(RMIClientTest.java:54)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at 展开
java.net.ConnectException: Connection refused: connect]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:227)
at cn.com.agree.monitor.RMIClientTest.main(RMIClientTest.java:54)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at 展开
2017-08-25
展开全部
你第一次通信成功之后,直到程序退出的你在代码中没有正常关闭网络连接导致端口堵塞,所以后面再连就连接不上,导致错误检查下你程序退出部分的代码,或者你第一次程序结束后去netstat查下端口的占用就知道怎么处理了
展开全部
权限够吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
拒绝连接到主机!!!权限,开远程了么?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询