我正在尝试为 websphere 创建一个简单的管理客户端应用程序:
我的代码:
属性 connectProps = new Properties(); connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
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:\Users\DummyClientTrustFile.jks"); connectProps.setProperty("javax.net.ssl.keyStore", "C:\Users\DummyClientKeyFile.jks"); connectProps.setProperty("javax.net.ssl.trustStorePassword", "admin"); connectProps.setProperty("javax.net.ssl.keyStorePassword", "admin");
AdminClient adminClient = null; 尝试 { adminClient = AdminClientFactory.createAdminClient(connectProps); } catch (ConnectorException e) { System.out.println("创建管理客户端的异常:" + e);
e.printStackTrace(); }
}
我收到的错误消息:
com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: 系统无法创建 SOAP 连接器以连接到端口 8879 处的主机 xxxx。在 com.ibm.websphere.management.AdminClientFactory.createAdminClientPriviled(AdminClientFactory.java:635)在 com.ibm.websphere.management.AdminClientFactory.access$000(AdminClientFactory.java:127) 在 com.ibm.websphere.management.AdminClientFactory$1.run(AdminClientFact ory.java:210) 在 com.ibm.ws.security .util.AccessController.doPrivileged(AccessController.java:63) at com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm inClientFactory.java:206) at TryConnection1.main(TryConnection1.java:42) 原因:java。 sun.reflect.NativeConstructorAccessorImpl 处的 lang.reflect.InvocationTargetException。newInstance0(本机方法)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.ibm.websphere.management.AdminClientFactory.createAdminClientPriviled(AdminClientFactory.java:457) ... 5 更多原因:java.lang.NoSuchMethodError: org.apache.soap.rpc.Call.WASinvoke(Ljava /net/URL;Ljava/lang/String;)Lorg/apache/soap/rpc/Response; 在 com.ibm.ws.management.connector.soap.SOAPConnectorClient$4.run(SOAPCon 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。
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.ibm.websphere.management.AdminClientFactory.createAdminClientPriviled(AdminClientFactory.java:457) at com.ibm.websphere.management.AdminClientFactory.access$000( AdminClient 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 /net/URL;Ljava/lang/String;)Lorg/apache/soap/rpc/Response; 在 com.ibm.ws.management.connector.soap。