Cusom JMX Admin client unable to connect to secured server - Websphere

This is a discussion on Cusom JMX Admin client unable to connect to secured server - Websphere ; Hi, I am trying to create a custom admin client for a stand alone websphere server (running on windows XP). Security is turned on for my server. Websphere Version -> RAD 7.0 Security -> Local OS Admin console is secured ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Cusom JMX Admin client unable to connect to secured server

  1. Cusom JMX Admin client unable to connect to secured server

    Hi,

    I am trying to create a custom admin client for a stand alone websphere server (running on windows XP). Security is turned on for my server.

    Websphere Version -> RAD 7.0
    Security -> Local OS

    Admin console is secured and it prompts for password. it accepts the windows administrator password. i am trying to use SOAP connector port available at 8881.

    i am able to get the admin client when security is turned off in my server. Am i missing something?

    here is the my code

    {
    Properties connectProps = new Properties();
    connectProps.setProperty(AdminClient.CONNECTOR_TYP E,
    AdminClient.CONNECTOR_TYPE_SOAP);
    connectProps.setProperty(AdminClient.CONNECTOR_HOS T, "localhost");
    connectProps.setProperty(AdminClient.CONNECTOR_POR T, "8881");
    connectProps.setProperty(AdminClient.CONNECTOR_SEC URITY_ENABLED, "true");
    connectProps.setProperty(AdminClient.CONNECTOR_SOA P_CONFIG, "file//C:\\Program files\\IBM\\SDP70\\runtimes\\base_v6\\profiles\\Aj ayProfile\\properties\\soap.client.props");

    AdminClient adminClient = null;
    try
    {
    adminClient = AdminClientFactory.createAdminClient(connectProps) ;
    }
    catch (ConnectorException e)
    {
    e.printStackTrace();
    System.out.println("Exception creating admin client: " + e);
    }

    System.out.println("Created admin client: " + adminClient);
    }


    i am getting the following exception

    om.ibm.websphere.management.exception.ConnectorExc eption: ADMC0053E: Could not create SOAP Connector to connect to host localhost at port 8881 with SOAP Connector security enabled.
    at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:359)
    at Test.main(Test.java:32)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:67)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:521)
    at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:300)
    ... 1 more
    Caused by: com.ibm.websphere.management.exception.ConnectorNo tAvailableException
    at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:253)
    at com.ibm.ws.management.connector.soap.SOAPConnector Client.(SOAPConnectorClient.java:186)
    ... 6 more
    Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory; targetException=java.lang.IllegalArgumentException : Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory]
    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.SOAPConnector Client$2.run(SOAPConnectorClient.java:236)
    at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:111)
    at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:233)
    ... 7 more
    ---- Begin backtrace for nested exception
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:67)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:521)
    at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:300)
    at Test.main(Test.java:32)
    Caused by: com.ibm.websphere.management.exception.ConnectorNo tAvailableException
    at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:253)
    at com.ibm.ws.management.connector.soap.SOAPConnector Client.(SOAPConnectorClient.java:186)
    ... 6 more
    Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory; targetException=java.lang.IllegalArgumentException : Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory]
    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.SOAPConnector Client$2.run(SOAPConnectorClient.java:236)
    at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:111)
    at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:233)
    ... 7 more
    Exception creating admin client: com.ibm.websphere.management.exception.ConnectorEx ception: ADMC0053E: Could not create SOAP Connector to connect to host localhost at port 8881 with SOAP Connector security enabled.
    Created admin client: null



  2. Re: Cusom JMX Admin client unable to connect to secured server

    This looks like whatever runtime you're using doesn't have the SSL
    libraries. Are you running this via WebSphere's 'launchClient' ?
    Ken

    ajaykumar.malepati@gmail.com wrote:
    > Hi,
    >
    > I am trying to create a custom admin client for a stand alone websphere server (running on windows XP). Security is turned on for my server.
    >
    > Websphere Version -> RAD 7.0
    > Security -> Local OS
    >
    > Admin console is secured and it prompts for password. it accepts the windows administrator password. i am trying to use SOAP connector port available at 8881.
    >
    > i am able to get the admin client when security is turned off in my server. Am i missing something?
    >
    > here is the my code
    >
    > {
    > Properties connectProps = new Properties();
    > connectProps.setProperty(AdminClient.CONNECTOR_TYP E,
    > AdminClient.CONNECTOR_TYPE_SOAP);
    > connectProps.setProperty(AdminClient.CONNECTOR_HOS T, "localhost");
    > connectProps.setProperty(AdminClient.CONNECTOR_POR T, "8881");
    > connectProps.setProperty(AdminClient.CONNECTOR_SEC URITY_ENABLED, "true");
    > connectProps.setProperty(AdminClient.CONNECTOR_SOA P_CONFIG, "file//C:\\Program files\\IBM\\SDP70\\runtimes\\base_v6\\profiles\\Aj ayProfile\\properties\\soap.client.props");
    >
    > AdminClient adminClient = null;
    > try
    > {
    > adminClient = AdminClientFactory.createAdminClient(connectProps) ;
    > }
    > catch (ConnectorException e)
    > {
    > e.printStackTrace();
    > System.out.println("Exception creating admin client: " + e);
    > }
    >
    > System.out.println("Created admin client: " + adminClient);
    > }
    >
    >
    > i am getting the following exception
    >
    > om.ibm.websphere.management.exception.ConnectorExc eption: ADMC0053E: Could not create SOAP Connector to connect to host localhost at port 8881 with SOAP Connector security enabled.
    > at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:359)
    > at Test.main(Test.java:32)
    > Caused by: java.lang.reflect.InvocationTargetException
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:67)
    > at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    > at java.lang.reflect.Constructor.newInstance(Construc tor.java:521)
    > at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:300)
    > ... 1 more
    > Caused by: com.ibm.websphere.management.exception.ConnectorNo tAvailableException
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:253)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.(SOAPConnectorClient.java:186)
    > ... 6 more
    > Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory; targetException=java.lang.IllegalArgumentException : Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory]
    > 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.SOAPConnector Client$2.run(SOAPConnectorClient.java:236)
    > at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:111)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:233)
    > ... 7 more
    > ---- Begin backtrace for nested exception
    > java.lang.reflect.InvocationTargetException
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:67)
    > at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    > at java.lang.reflect.Constructor.newInstance(Construc tor.java:521)
    > at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:300)
    > at Test.main(Test.java:32)
    > Caused by: com.ibm.websphere.management.exception.ConnectorNo tAvailableException
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:253)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.(SOAPConnectorClient.java:186)
    > ... 6 more
    > Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory; targetException=java.lang.IllegalArgumentException : Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory]
    > 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.SOAPConnector Client$2.run(SOAPConnectorClient.java:236)
    > at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:111)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:233)
    > ... 7 more
    > Exception creating admin client: com.ibm.websphere.management.exception.ConnectorEx ception: ADMC0053E: Could not create SOAP Connector to connect to host localhost at port 8881 with SOAP Connector security enabled.
    > Created admin client: null
    >
    >


  3. Re: Cusom JMX Admin client unable to connect to secured server

    Ken,
    Thanks for your reply. I am not using the launch client tool. i am running is as Plain old java class with the following jars in the classpath.

    Any ideas how to solve this issue?

    -Dcom.ibm.SOAP.ConfigURL="file://C:/Program Files/IBM/SDP70/runtimes/base_v6/profiles/AjayProfile/properties/soap.client.props"

    -Dwas.install.root="C:/Program Files/IBM/SDP70/runtimes/base_v6/" -Dws.ext.dirs="C:/Program Files/IBM/SDP70/runtimes/base_v6/java/lib;C:/Program
    Files/IBM/SDP70/runtimes/base_v6/profiles/AjayProfile/classes;C:/Program Files/IBM/SDP70/runtimes/base_v6/classes;C:/Program Files/IBM/SDP70/runtimes/base_v6/lib;C:/Program Files/IBM/SDP70/runtimes/base_v6/installedChannels;C:/Program
    Files/IBM/SDP70/runtimes/base_v6/lib/ext;C:/Program Files/IBM/SDP70/runtimes/base_v6/web/help;C:/Program
    Files/IBM/SDP70/runtimes/base_v6/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime" -classpath "C:/Program Files/IBM/SDP70/runtimes/base_v6/profiles/AjayProfile/properties;C:/Program Files/IBM/SDP70/runtimes/base_v6/properties;C:/Program
    Files/IBM/SDP70/runtimes/base_v6/lib/bootstrap.jar;C:/Program Files/IBM/SDP70/runtimes/base_v6/lib/j2ee.jar;C:/Program
    Files/IBM/SDP70/runtimes/base_v6/lib/lmproxy.jar;C:/Program Files/IBM/SDP70/runtimes/base_v6/lib/urlprotocols.jar"

  4. Re: Cusom JMX Admin client unable to connect to secured server

    ajaykumar.malepati@gmail.com wrote:
    > Hi,
    >
    > I am trying to create a custom admin client for a stand alone websphere server (running on windows XP). Security is turned on for my server.
    >
    > Websphere Version -> RAD 7.0
    > Security -> Local OS
    >
    > Admin console is secured and it prompts for password. it accepts the windows administrator password. i am trying to use SOAP connector port available at 8881.
    >
    > i am able to get the admin client when security is turned off in my server. Am i missing something?
    >
    > here is the my code
    >
    > {
    > Properties connectProps = new Properties();
    > connectProps.setProperty(AdminClient.CONNECTOR_TYP E,
    > AdminClient.CONNECTOR_TYPE_SOAP);
    > connectProps.setProperty(AdminClient.CONNECTOR_HOS T, "localhost");
    > connectProps.setProperty(AdminClient.CONNECTOR_POR T, "8881");
    > connectProps.setProperty(AdminClient.CONNECTOR_SEC URITY_ENABLED, "true");
    > connectProps.setProperty(AdminClient.CONNECTOR_SOA P_CONFIG, "file//C:\\Program files\\IBM\\SDP70\\runtimes\\base_v6\\profiles\\Aj ayProfile\\properties\\soap.client.props");
    >
    > AdminClient adminClient = null;
    > try
    > {
    > adminClient = AdminClientFactory.createAdminClient(connectProps) ;
    > }
    > catch (ConnectorException e)
    > {
    > e.printStackTrace();
    > System.out.println("Exception creating admin client: " + e);
    > }
    >
    > System.out.println("Created admin client: " + adminClient);
    > }
    >
    >
    > i am getting the following exception
    >
    > om.ibm.websphere.management.exception.ConnectorExc eption: ADMC0053E: Could not create SOAP Connector to connect to host localhost at port 8881 with SOAP Connector security enabled.
    > at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:359)
    > at Test.main(Test.java:32)
    > Caused by: java.lang.reflect.InvocationTargetException
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:67)
    > at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    > at java.lang.reflect.Constructor.newInstance(Construc tor.java:521)
    > at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:300)
    > ... 1 more
    > Caused by: com.ibm.websphere.management.exception.ConnectorNo tAvailableException
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:253)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.(SOAPConnectorClient.java:186)
    > ... 6 more
    > Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory; targetException=java.lang.IllegalArgumentException : Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory]
    > 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.SOAPConnector Client$2.run(SOAPConnectorClient.java:236)
    > at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:111)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:233)
    > ... 7 more
    > ---- Begin backtrace for nested exception
    > java.lang.reflect.InvocationTargetException
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    > at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:67)
    > at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    > at java.lang.reflect.Constructor.newInstance(Construc tor.java:521)
    > at com.ibm.websphere.management.AdminClientFactory.cr eateAdminClient(AdminClientFactory.java:300)
    > at Test.main(Test.java:32)
    > Caused by: com.ibm.websphere.management.exception.ConnectorNo tAvailableException
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:253)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.(SOAPConnectorClient.java:186)
    > ... 6 more
    > Caused by: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory; targetException=java.lang.IllegalArgumentException : Error opening socket: java.net.SocketException: Cannot find the specified class java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.ibm.websphere.ssl.protocol.SSLSocketFactory]
    > 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.SOAPConnector Client$2.run(SOAPConnectorClient.java:236)
    > at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:111)
    > at com.ibm.ws.management.connector.soap.SOAPConnector Client.reconnect(SOAPConnectorClient.java:233)
    > ... 7 more
    > Exception creating admin client: com.ibm.websphere.management.exception.ConnectorEx ception: ADMC0053E: Could not create SOAP Connector to connect to host localhost at port 8881 with SOAP Connector security enabled.
    > Created admin client: null
    >
    >


    On my WebSphere 6.1 system (don't know which runtime you're running out
    of RAD7), that class is in
    /plugins/com.ibm.ws.security.crypto_6.1.0.jar

    Ken

  5. Re: Cusom JMX Admin client unable to connect to secured server

    Hi,

    I have tried to run a small sample code piece using WAS 6.1 runtime
    that comes embedded in RAD 7.0. I hope this will help you to resolve
    your issue....

    private void createAdminClient()
    {
    // Set up a Properties object for the JMX connector attributes
    System.out.println("Creating Property object");

    Properties connectProps = new Properties();
    connectProps.setProperty(AdminClient.CONNECTOR_TYP E,
    AdminClient.CONNECTOR_TYPE_SOAP);
    connectProps.setProperty(AdminClient.CONNECTOR_HOS T,
    "localhost");
    connectProps.setProperty(AdminClient.CONNECTOR_POR T, "8880");

    connectProps.setProperty(AdminClient.CONNECTOR_SEC URITY_ENABLED,
    "true");
    connectProps.setProperty(AdminClient.USERNAME, "< with the WAS Admin user name >>");
    connectProps.setProperty(AdminClient.PASSWORD, "< with the WAS Admin user password>>");

    //This is necessary for SSl connection
    connectProps.setProperty("javax.net.ssl.trustStore", "E:/IBM/
    WebSphere/AppServer/profiles/AppSrv01/etc/DummyClientTrustFile.jks");
    connectProps.setProperty("javax.net.ssl.keyStore", "E:/IBM/
    WebSphere/AppServer/profiles/AppSrv01/etc/DummyClientKeyFile.jks");
    connectProps.setProperty("javax.net.ssl.trustStorePassword",
    "WebAS");
    connectProps.setProperty("javax.net.ssl.keyStorePassword",
    "WebAS");

    System.out.println("Successfully created property object");


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

    System.out.println("Connected to server");
    }


    Then I tried to run the code using following statements(following
    statement was in batch file):

    set WAS_HOME=E:\IBM\WebSphere\AppServer

    set CLASSPATH=.;E:\IBM\WebSphere\AppServer\profiles
    \AppSrv01\properties;%WAS_HOME%\tmx4jTransform.jar ;E:/IBM/WebSphere/
    AppServer/plugins/com.ibm.ws.wccm_6.1.0.jar
    set JAVA_LIB=-Djava.ext.dirs=%WAS_HOME%\java\jre\lib;%WAS_HOME%\ java
    \jre\lib\ext;%WAS_HOME%\lib;%WAS_HOME%\plugins

    %WAS_HOME%\java\bin\java -cp %CLASSPATH% %JAVA_LIB% -Dwas.install.root=
    %WAS_HOME% -Djavax.net.debug=true com.test.StandAloneJavaClient



    Amit Srivastava


  6. Re: Cusom JMX Admin client unable to connect to secured server

    hi,

    how will i find out if the credentials given are right or no?
    i gave wrong username and password in
    connectionProperties.setProperty(AdminClient.USERN AME, username);
    connectionProperties.setProperty(AdminClient.PASSW ORD, password);

    how ever after
    clientConfig = AdminClientFactory.createAdminClient(connectionPro perties);

    i checked connection as
    if (clientConfig == null) then consider as connection failure due to wrong password.


    However, i see that in case of wrong password as well, clientConfig is not null



    please help.
    How to i authenticare the username and password , in order to login threough was through adminclient program

+ Reply to Thread