我正在尝试为websphere创建一个简单的管理客户端应用程序:
我的代码:
属性connectProps = new Properties(); connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "真&#34);
connectProps.setProperty(AdminClient.CONNECTOR_HOST," XXXXX"); connectProps.setProperty(AdminClient.CONNECTOR_PORT," 8879"); connectProps.setProperty(AdminClient.USERNAME," admin"); connectProps.setProperty(AdminClient.PASSWORD," admin"); connectProps.setProperty(" javax.net.ssl.trustStore中"" C:\用户\ DummyClientTrustFile.jks&#34); connectProps.setProperty(" javax.net.ssl.keyStore&#34 ;, " C:\用户\ DummyClientKeyFile.jks&#34); connectProps.setProperty(" javax.net.ssl.trustStorePassword"," admin"); connectProps.setProperty(" javax.net.ssl.keyStorePassword"," admin");
AdminClient adminClient = null;尝试{ adminClient = AdminClientFactory.createAdminClient(connectProps);抓住 (ConnectorException e){ System.out.println("异常创建管理客户端:" + e);
e.printStackTrace(); }
}
我收到的错误消息:
com.ibm.websphere.management.exception.ConnectorException: ADMC0016E:系统无法创建要连接的SOAP连接器 在端口8879上托管xxxx。 在com.ibm.websphere.management.AdminClientFactory.createAdminClientPriv ileged(AdminClientFactory.java:635) 在com.ibm.websphere.management.AdminClientFactory.access $ 000(AdminClien tFactory.java:127) 在com.ibm.websphere.management.AdminClientFactory $ 1.run(AdminClientFact) ory.java:210) 在com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll) er.java:63) 在com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm) inClientFactory.java:206) 在TryConnection1.main(TryConnection1.java:42)引起:java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
RCE) at java.lang.reflect.Constructor.newInstance(Unknown Source) 在com.ibm.websphere.management.AdminClientFactory.createAdminClientPriv ileged(AdminClientFactory.java:457) ... 5更多引起:java.lang.NoSuchMethodError:org.apache.soap.rpc.Call.WASinvoke(Ljava /净/ URL; Ljava /郎/字符串;)Lorg /阿帕奇/肥皂/ RPC /响应; 在com.ibm.ws.management.connector.soap.SOAPConnectorClient $ 4.run(SOAPCo) nnectorClient.java:373) 在com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll) er.java:118) 在com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SO APConnectorClient.java:366) 在com.ibm.ws.management.connector.soap.SOAPConnectorClient。(SOAPC onnectorClient.java:222) ......还有10个 ----开始回溯嵌套异常java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
RCE) at java.lang.reflect.Constructor.newInstance(Unknown Source) 在com.ibm.websphere.management.AdminClientFactory.createAdminClientPriv ileged(AdminClientFactory.java:457) 在com.ibm.websphere.management.AdminClientFactory.access $ 000(AdminClien tFactory.java:127) 在com.ibm.websphere.management.AdminClientFactory $ 1.run(AdminClientFact) ory.java:210) 在com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll) er.java:63) 在com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm) inClientFactory.java:206) 在TryConnection1.main(TryConnection1.java:42)引起:java.lang.NoSuchMethodError:org.apache.soap.rpc.Call.WASinvoke(Ljava) /净/ URL; Ljava /郎/字符串;)Lorg /阿帕奇/肥皂/ RPC /响应; 在com.ibm.ws.management.connector.soap.SOAPConnectorClient $ 4.run(SOAPCo) nnectorClient.java:373) 在com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll) er.java:118) 在com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SO APConnectorClient.java:366) 在com.ibm.ws.management.connector.soap.SOAPConnectorClient。(SOAPC onnectorClient.java:222) ......还有10个
答案 0 :(得分:0)
好像你在你的类路径中混合了错误的jar / jre。可能是IBM adminclient jar和sun JRE?还是错误的xml / soap jars?
我从未真正尝试直接调用adminclient jar。更好的支持方式是使用IBM的wsadmin.sh脚本并通过jython调用AdminClient接口。在屏幕后面,这也将完成您从java中所做的操作,因此您可以对该脚本进行反向工程,以查看哪些jre和哪些jar实际用于实现神奇的工作。
有关wsadmin的websphere v6.1文档,请参阅http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.doc/info/aes/ae/rxml_commandline.html。