【开源中国 APP 全新上线】“动弹” 回归、集成大模型对话、畅读技术报告”
JMX与websphere建立连接过程抛出IOException
请各位帮我看看是什么原因:
连接方法如下:
public void createJMXConnector(){ String host="localhost"; String port="2310"; String jndiPath="/jndi/JMXConnector"; //Hashtable h = new Hashtable(); try{ JMXServiceURL serviceURL=new JMXServiceURL("service:jmx:iiop://"+host+":"+port+jndiPath); jmxConnector=JMXConnectorFactory.connect(serviceURL); msCon=jmxConnector.getMBeanServerConnection(); System.out.println("Connected to DeploymentManager"); }catch(SecurityException e){ System.out.println("SecurityException="+e.getMessage()); } catch(IOException e){ System.out.println("IOException="+e.getMessage()); } catch(Exception e){ System.out.println(e.getMessage()); } }
抛出异常如下:
IOException=Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: Context: MZ9WJAENVT3WIL9Node01Cell/nodes/MZ9WJAENVT3WIL9Node01/servers/server1, name: JMXConnector: First component in name JMXConnector not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
不知道您实现了没有,我最近做这个也遇到了问题