gpt4 book ai didi

java - Websphere 管理工具应用程序

转载 作者:行者123 更新时间:2023-12-01 04:46:58 24 4
gpt4 key购买 nike

我正在尝试为 websphere 创建一个简单的管理客户端应用程序:

我的代码:

Properties 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; try { adminClient = AdminClientFactory.createAdminClient(connectProps); } catch (ConnectorException e) { System.out.println("Exception creating admin client: " + e);

 e.printStackTrace(); }

}

我收到的错误消息:

com.ibm.websphere.management.exception.ConnectorException: ADMC0016E:The system cannot create a SOAP connector to connect to host xxxx at port 8879. at com.ibm.websphere.management.AdminClientFactory.createAdminClientPriv ileged(AdminClientFactory.java:635) at com.ibm.websphere.management.AdminClientFactory.access$000(AdminClien tFactory.java:127) at com.ibm.websphere.management.AdminClientFactory$1.run(AdminClientFact ory.java:210) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll er.java:63) at com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm inClientFactory.java:206) at TryConnection1.main(TryConnection1.java:42) Caused by: 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) at com.ibm.websphere.management.AdminClientFactory.createAdminClientPriv ileged(AdminClientFactory.java:457) ... 5 more Caused by: java.lang.NoSuchMethodError: org.apache.soap.rpc.Call.WASinvoke(Ljava /net/URL;Ljava/lang/String;)Lorg/apache/soap/rpc/Response; at com.ibm.ws.management.connector.soap.SOAPConnectorClient$4.run(SOAPCo nnectorClient.java:373) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll er.java:118) at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SO APConnectorClient.java:366) at com.ibm.ws.management.connector.soap.SOAPConnectorClient.(SOAPC onnectorClient.java:222) ... 10 more ---- Begin backtrace for nested exception 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) at com.ibm.websphere.management.AdminClientFactory.createAdminClientPriv ileged(AdminClientFactory.java:457) at com.ibm.websphere.management.AdminClientFactory.access$000(AdminClien tFactory.java:127) at com.ibm.websphere.management.AdminClientFactory$1.run(AdminClientFact ory.java:210) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll er.java:63) at com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm inClientFactory.java:206) at TryConnection1.main(TryConnection1.java:42) Caused by: java.lang.NoSuchMethodError: org.apache.soap.rpc.Call.WASinvoke(Ljava /net/URL;Ljava/lang/String;)Lorg/apache/soap/rpc/Response; at com.ibm.ws.management.connector.soap.SOAPConnectorClient$4.run(SOAPCo nnectorClient.java:373) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessControll er.java:118) at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SO APConnectorClient.java:366) at com.ibm.ws.management.connector.soap.SOAPConnectorClient.(SOAPC onnectorClient.java:222) ... 10 more

最佳答案

似乎您在类路径中混合了错误的 jars/jre。可能是 IBM adminclient jar 和 sun JRE?或者错误的 xml/soap jar ?

我实际上从未尝试过直接调用 adminclient jar。更好的支持方法是使用 IBM 的 wsadmin.sh 脚本并通过 jython 调用 AdminClient 接口(interface)。在屏幕后面,这也将执行您在 java 中执行的操作,因此您可以对该脚本进行反向工程,以查看实际使用了哪些 jre 和哪些 jar 来实现神奇的效果。

参见http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.doc/info/aes/ae/rxml_commandline.html有关 wsadmin 的 websphere v6.1 文档。

关于java - Websphere 管理工具应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15658898/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com