WebSphere管理客户端连接错误

时间:2017-10-10 11:04:25

标签: java websphere

我在WebSphere管理客户端创建过程中遇到连接错误。 我阅读了很多论坛,但无法修复它。

"Exception creating Admin Client Connection: com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: The system cannot create a SOAP connector to connect to host "111.xxxx.." at port 8879."
  • 我的dmgr端口是8879
  • 主机名是“111.xxxx ..”
  • 服务器配置文件位于c:\ temp \ soap.client.props,DummyClientTrustFile.jks,DummyClientKeyFile.jks

我的代码如下:

import java.util.Date;
import java.util.Properties;
import java.util.Set;

import javax.management.InstanceNotFoundException;
import javax.management.MalformedObjectNameException;
import javax.management.Notification;
import javax.management.NotificationListener;
import javax.management.ObjectName;

import com.ibm.websphere.management.AdminClient;
import com.ibm.websphere.management.AdminClientFactory;
import com.ibm.websphere.management.exception.ConnectorException;

public class AdminClientConnection
{
    private AdminClient adminClient;

    public static void main(String[] args)
    {
        AdminClientConnection aClient = new AdminClientConnection();

        // Create an AdminClient
        aClient.createAdminClient();

    }

    private void createAdminClient()
    {
        // Set up a Properties object for the JMX connector attributes
        Properties clientProps = new Properties();
        clientProps.setProperty(
        AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP);
        clientProps.setProperty(AdminClient.CONNECTOR_HOST, "111.xxxx..");
        clientProps.setProperty(AdminClient.CONNECTOR_PORT, "8879");
        clientProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
        clientProps.setProperty(AdminClient.USERNAME, "usr");
        clientProps.setProperty(AdminClient.PASSWORD, "pass");
        clientProps.setProperty(AdminClient.CONNECTOR_SOAP_CONFIG, "c:/temp/soap.client.props");        
        clientProps.setProperty("javax.net.ssl.trustStore", "c:/temp/DummyClientTrustFile.jks");
        clientProps.setProperty("javax.net.ssl.keyStore", "c:/temp/DummyClientKeyFile.jks");
        clientProps.setProperty("javax.net.ssl.trustStorePassword", "WebAS");
        clientProps.setProperty("javax.net.ssl.keyStorePassword", "WebAS");

        // Get an AdminClient based on the connector properties
        try
        {
            adminClient = AdminClientFactory.createAdminClient(clientProps);
        }
        catch (ConnectorException e)
        {
            System.out.println("Exception creating Admin Client Connection: " + e);
            System.exit(-1);
        }

        System.out.println("Connected to Application Server");
    }

}

1 个答案:

答案 0 :(得分:0)

确保CONNECTOR_PORT为真,CONNECTOR_SECURITY_ENABLED不是必需的。确保从连接器主机收集soap.client.props和jks文件。