创建多个websphere连接出现异常?
我的代码如下:
public class TestConn { /** * @param args */ public static void main(String[] args) { test221(); test129(); } public static void test221(){ Properties connectProps = new Properties(); connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); connectProps.setProperty(AdminClient.CONNECTOR_HOST, "192.168.1.221"); connectProps.setProperty(AdminClient.CONNECTOR_PORT, "8880"); connectProps.setProperty(AdminClient.USERNAME, "root"); connectProps.setProperty(AdminClient.PASSWORD, "sino"); connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true"); connectProps.setProperty("javax.net.ssl.trustStore","e:/webSphere/test_1/trust.jks"); connectProps.setProperty("javax.net.ssl.keyStore", "e:/webSphere/test_1/store.jks"); connectProps.setProperty("javax.net.ssl.trustStorePassword", "oracle"); connectProps.setProperty("javax.net.ssl.keyStorePassword", "oracle"); try { AdminClient adminClient = AdminClientFactory .createAdminClient(connectProps); System.out.println(adminClient); } catch (ConnectorException e) { e.printStackTrace(); } } public static void test129(){ Properties connectProps = new Properties(); connectProps.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); connectProps.setProperty(AdminClient.CONNECTOR_HOST, "192.168.1.129"); connectProps.setProperty(AdminClient.CONNECTOR_PORT, "8881"); connectProps.setProperty(AdminClient.USERNAME, "root"); connectProps.setProperty(AdminClient.PASSWORD, "admin"); connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true"); connectProps.setProperty("javax.net.ssl.trustStore", "e:/webSphere/test/trust.jks"); connectProps.setProperty("javax.net.ssl.keyStore", "e:/webSphere/test/store.jks"); connectProps.setProperty("javax.net.ssl.trustStorePassword", "jks"); connectProps.setProperty("javax.net.ssl.keyStorePassword", "jks"); try { AdminClient adminClient = AdminClientFactory .createAdminClient(connectProps); System.out.println(adminClient); } catch (ConnectorException e) { e.printStackTrace(); } } }
运行结果如下:
com.ibm.ws.management.AdminClientImpl@d42d08 2012-8-17 16:24:02 com.ibm.websphere.management.AdminClientFactory 警告: ADMC0046W com.ibm.websphere.management.exception.ConnectorException: ADMC0053E: 启用 SOAP 连接器安全性时,系统无法创建连接到端口 8881 上的主机 192.168.1.129 的 SOAP 连接器。 at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:476) at TestConn.test129(TestConn.java:56) at TestConn.main(TestConn.java:14) 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 Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:331) ... 2 more Caused by: com.ibm.websphere.management.exception.ConnectorNotAvailableException: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; targetException=java.lang.IllegalArgumentException: Error opening socket: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target] at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:338) at com.ibm.ws.management.connector.soap.SOAPConnectorClient.<init>(SOAPConnectorClient.java:175) ... 7 more Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; targetException=java.lang.IllegalArgumentException: Error opening socket: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target] at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source) at org.apache.soap.rpc.Call.invoke(Unknown Source) at com.ibm.ws.management.connector.soap.SOAPConnectorClient$4.run(SOAPConnectorClient.java:303) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:296) ... 8 more请问为什么第二个连接不能创建成功呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
急求高手指点,谢谢。
同求
同求解决方案
记得当时我没有解决这问题,我也只是能创建一个连接
你好,不知道这个问题,你当时是怎么解决的
我有正确引用了证书的路径,但异常不知道为什么还是说证书错误
无法找到合法的证书
虽然打印异常出来,但问题没有解决,不知道在同一文件中创建两个连接是不是根本就是错误的
回复
启用 SOAP 连接器安全性时,系统无法创建连接到端口 8881 上的主机 192.168.1.129 的 SOAP 连接器。 问题应该在这
异常不都打出来了么。。。