使用AdminClient 连接Websphere 7
来源:互联网 发布:金山手机数据恢复大师 编辑:程序博客网 时间:2024/05/22 17:34
写了一个简单的jmx client 去连接websphere 7 的 jmx server:
Properties props = new Properties();
props.setProperty(AdminClient.CONNECTOR_HOST, "localhost");
props.setProperty(AdminClient.CONNECTOR_PORT, "8883");
props.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);
props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
props.setProperty(AdminClient.USERNAME, "wasadmin");
props.setProperty(AdminClient.PASSWORD, "password");
props.setProperty(SECURITY_TRUST_STORE, "D://Program Files//IBM//WebSphere//AppServer//profiles//13SProfile2//etc//" + SECURITY_DUMMY_CLIENT_TRUST_FILE);
props.setProperty(SECURITY_KEY_STORE, "D://Program Files//IBM//WebSphere//AppServer//profiles//13SProfile2//etc//" + SECURITY_DUMMY_CLIENT_KEY_FILE);
props.setProperty(SECURITY_TRUST_STORE_PASSWD, "WebAS");
props.setProperty(SECURITY_KEY_STORE_PASSWD, "WebAS");
AdminClient adminClient = AdminClientFactory.createAdminClient(props);
系统总是报错:
CWPKI0040I: An SSL handshake failure occurred from a secure client. The server'
s SSL signer has to be added to the client's trust store. A retrieveSigners uti
lity is provided to download signers from the server but requires administrative
permission. Check with your administrator to have this utility run to setup th
e secure enviroment before running the client. Alternatively, the com.ibm.ssl.e
nableSignerExchangePrompt can be enabled in ssl.client.props for "DefaultSSLSett
ings" in order to allow acceptance of the signer during the connection attempt.
com.ibm.websphere.management.exception.ConnectorException: ADMC0053E: The system
cannot create a SOAP connector to connect to host localhost at port 8883 with S
OAP connector security enabled.
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(Adm
inClientFactory.java:476)
java.security.cert.CertPathValidatorException: Certificate chaining erro
r; targetException=java.lang.IllegalArgumentException: Error opening socket: jav
ax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.g: PKIX path building faile
d: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could no
t build a valid CertPath.; internal cause is:
这个问题困扰了半天,怀疑是server与 client通讯中的signer问题,后来在连接的property里面加上一个属性:props.setProperty(AdminClient.CONNECTOR_AUTO_ACCEPT_SIGNER, "true"),问题解决了。
查了一下官方说法:
Specifies whether the WebSphere administration client programmatically trusts the connection, without storing the signer in the local truststore. This property is internal to the WebSphere administration client. Do not modify it. For example:
autoAcceptSignerForThisConnectionOnly=true
- 使用AdminClient 连接Websphere 7
- 使用jms工厂连接websphere mq
- 利用基于 JMX 的 AdminClient 获取 WebSphere Application Server 的环境参数
- 将 JMS 连接池与 WebSphere Application Server 和 WebSphere MQ 一起使用,第 1 部分
- WebSphere使用数据源连接数据库的事务问题
- 使用SOAP协议修改websphere数据源的密码,测试连接
- websphere 使用JNDI连接数据源的配置文件编写
- Trouble Shooting -- WebSphere 连接池不够使用的问题
- websphere 连接 DB2 错误
- websphere连接数据库
- WebSphere--连接管理器
- WebSphere MQ Jms 连接
- WebSphere连接AS400的DB2
- WebSphere 根据 jndi 连接 MSSQL
- websphere 连接池的配置
- JMX连接WebSphere和WebLogic
- WebSphere连接池参数详解
- WebSphere连接池参数详解
- 动态更改itemRenderer
- java高级特性
- Fortran 组合逻辑运算符
- 不靠谱的生命三角
- GridView全选和批量删除
- 使用AdminClient 连接Websphere 7
- DevExpress控件之comboBoxEx(comboBoxEx1.SelectedText与comboBoxEx1.SelectedItem的区别)
- ibatis查询出结果持久化时遇到的问题
- 渔夫的故事
- 纠结
- 树的概念
- 摘抄感叹
- GDI+从资源中加载图片
- DropDownList无限级分类灵活控制显示形式