• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMX Admin client unable to connect to secured Websphere server

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to create a custom admin client for a stand alone websphere server. Security is turned on for my server.

Websphere Version -> 6.1.0
Security -> Federal Repository


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 8882.

I am able to get the admin client when security is turned off in my server. But when security is turned on i get an error.

My code and the error i get is:

------------------------------------------------------------
CODE
------------------------------------------------------------
java.util.Properties props = new java.util.Properties();
props.setProperty(AdminClient.CONNECTOR_TYPE, "SOAP");
props.setProperty(AdminClient.CONNECTOR_HOST, "blrkec95828d");
props.setProperty(AdminClient.CONNECTOR_PORT, "8882");
props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
props.setProperty(AdminClient.USERNAME, "user1");
props.setProperty(AdminClient.PASSWORD, "user24test");
props.setProperty("javax.net.ssl.trustStore", "C:/Program Files/IBM/WebSphere/AppServer2/profiles/AppSrv02/etc/DummyClientTrustFile.jks");
props.setProperty("javax.net.ssl.keyStore", "C:/Program Files/IBM/WebSphere/AppServer2/profiles/AppSrv02/etc/DummyClientKeyFile.jks");
props.setProperty("javax.net.ssl.trustStorePassword", "WebAS");
props.setProperty("javax.net.ssl.keyStorePassword", "WebAS");

try{
acl = AdminClientFactory.createAdminClient(props);
}
catch(Exception ex){
new AdminException(ex).printStackTrace();
}

--------------------------------------------------------------------
ERROR
--------------------------------------------------------------------
Feb 25, 2009 2:05:20 PM com.ibm.websphere.management.AdminClientFactory
WARNING: ADMC0046W
Feb 25, 2009 2:05:20 PM com.ibm.ws.management.connector.interop.JMXClassLoader
WARNING: Could not find tmx4jTransform.jar in null/etc/tmx4jTransform.jar - Interoperability to older versions of WebSphere is disabled
Feb 25, 2009 2:05:21 PM com.ibm.ws.ssl.config.SSLConfigManager
INFO: ssl.disable.url.hostname.verification.CWPKI0027I
Feb 25, 2009 2:05:21 PM com.ibm.ws.ssl.provider.AbstractJSSEProvider
SEVERE: CWPKI0029E: SSL context provider "IBMJSSE2" is not valid. This provider is specified in the SSL configuration alias "DefaultSystemProperties" loaded from SSL configuration file "System Properties". The extended error message is: "no such provider: IBMJSSE2".
com.ibm.websphere.management.exception.AdminException: com.ibm.websphere.management.exception.ConnectorException: ADMC0053E: The system cannot create a SOAP connector to connect to host blrkec95828d at port 8882 with SOAP connector security enabled.
at Test.setAdminClient(Test.java:57)
at Test.main(Test.java:431)
Caused by: com.ibm.websphere.management.exception.ConnectorException: ADMC0053E: The system cannot create a SOAP connector to connect to host blrkec95828d at port 8882 with SOAP connector security enabled.
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:476)
at Test.setAdminClient(Test.java:49)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
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: java.net.SocketException; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.SocketException]
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: java.net.SocketException; targetException=java.lang.IllegalArgumentException: Error opening socket: java.net.SocketException]
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:311)
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
getAdminClient: exception
java.lang.NullPointerException
at Test.getPerfObject(Test.java:229)
at Test.getStatDescriptor(Test.java:165)
at Test.main(Test.java:441)
Exception java.lang.NullPointerException
-------------------------------------------------------------------------

PLEASE HELP....
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

your code seems fine.

now you must take care about the execution and the jar files loaded.

for example I use a java program to connect to my App Servers like you :

public static AdminClient createAdminClient()
//private void createAdminClient()
{
AdminClient adminc = null;
// Définition d'un objet Properties pour les attributs du connecteur JMX
Properties connectProps = new Properties();
connectProps.setProperty(AdminClient.CONNECTOR_TYPE, connector);
connectProps.setProperty(AdminClient.CONNECTOR_HOST, host);
connectProps.setProperty(AdminClient.CONNECTOR_PORT, port);
connectProps.setProperty(AdminClient.CACHE_DISABLED, "false");
connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, security);
if (security.equalsIgnoreCase("true")){
connectProps.setProperty(AdminClient.USERNAME, user);
connectProps.setProperty(AdminClient.PASSWORD, password);
connectProps.setProperty("javax.net.ssl.trustStore", trust_path);
connectProps.setProperty("javax.net.ssl.trustStorePassword", trust_pwd);
}

// Extraction d'un client d'administration d'après les propriétés du connecteur
try
{
adminc = 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 " + server);
return adminc;
}


For the execution you need to add WebSphere jar files on top of your CLASSPATH:


ws_runtime.jar

Please try this and let we know if it solve your problems.



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic