问题描述
问题出现的环境背景及自己尝试过哪些方法
已经检查过Url构造是没有问题,服务器也是正常可访问的。
参考过NoInitialContextException error,但是还是不知如何解决。
相关代码
[oracle@biapptst jmx]$ java -classpath .:./wlclient.jar MBeanAPIExample1 localhost 9500 weblogic password
Connecting using URL: service:jmx:iiop://localhost:9500/jndi/weblogic.management.mbeanservers.domainruntime ...
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at MBeanAPIExample1.connect(MBeanAPIExample1.java:50)
at MBeanAPIExample1.main(M