wood burning stoves 2.0*
The moose likes Websphere and the fly likes WAS 6.1 JMX AdminClient. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS 6.1 JMX AdminClient." Watch "WAS 6.1 JMX AdminClient." New topic

WAS 6.1 JMX AdminClient.

Askar Akhmerov

Joined: Apr 13, 2010
Posts: 20

Hello, I am trying to implement custom AdminClient following examples provided by IBM.
however I am not able to instanciate AdminClient object.
my code looks like this:

I've put files form
C:\Program Files\IBM\WebSphere\AppServer\runtimes\
to my build path, in order to make this thing compile without errors.

my soap.client.props has following settings:


So, if i execute that class I'm getting following exceptions:

com.ibm.websphere.management.exception.ConnectorException: ADMC0016E: The system cannot create a SOAP connector to connect to host localhost at port 8879.
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:479)
at My.main(My.java:17)
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:513)
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:331)
... 1 more
Caused by: com.ibm.websphere.management.exception.ConnectorNotAvailableException: [SOAPException: faultCode=SOAP-ENV:Client; msg=Error parsing HTTP status line " java.util.NoSuchElementException; targetException=java.lang.IllegalArgumentException: Error parsing HTTP status line "java.util.NoSuchElementException]
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)
... 7 more

What I would like to do is to be able to access PMI data throug JMX.

Any ideas on what's happening here would be appriciated. Thank you in advance.
Askar Akhmerov

Joined: Apr 13, 2010
Posts: 20

Problem solved with the sourcecode:

Now conclusion is: Sequrity considered to be enabled if you have checkbox "Enable administrative security" marked in the console.
port number to use: could be viewed in the application server ports list. as SOAP_CONNECTOR_ADDRESS.

Damien Renier

Joined: Jul 28, 2010
Posts: 1
first of all, thank you, Askar, for these useful information, as I was struggling to understand what was going on. Admins told me there was no SSL when I started coding and hence testing. >_<

Anyway I don't know anything about WebSphere and I haven't been able to sort this out as mention in the sample.
I don't know if I misspelled the file path or if the password is not common or if this Dummy key has been removed from the WAS or else...

I manage to get it work due to this other link: http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21154255

As I'm in a hurry, I will not investigate further. Now it works fine on my side as well : )

BTW, I'd like to add that the first error is due to this line not being specified (default)
props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "false");
No security then = Cannot parse.... but I had some dodgy characters (in my eclipse console) after the quote (6 small squares)

Then I changed this line to: props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
and the error was:
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.g: PKIX path building failed: java.security.cert.CertPathBuilderException: unable to find valid certification path to requested target; targetException=java.lang.IllegalArgumentException:

Then I went to IBM website, via google, and find out how to set the .jks files on my client side and so on...
For the Server certificate, if it is not present on your local machine (client) then use the certificate your browser is using when accessing the WAS console

for instance I ended with these lines:
props.setProperty("javax.net.ssl.trustStore", "C:/Program Files/IBM/SDP70/runtimes/base_v61/bin/ClientTrust.jks");
props.setProperty("javax.net.ssl.keyStore", "C:/Program Files/IBM/SDP70/runtimes/base_v61/bin/ClientKey.jks");
props.setProperty("javax.net.ssl.trustStorePassword", "qpbv6TY7,./");
props.setProperty("javax.net.ssl.keyStorePassword", "qpbv6TY7,./");

Once again, thank you Askar, for this useful post.

I agree. Here's the link: http://aspose.com/file-tools
subject: WAS 6.1 JMX AdminClient.
Similar Threads
IBM WSAD...error
Not able to connect using SOAP with WAS 6.1 server
SecurityException while sending to gmail from javamail
Cusom JMX Admin client unable to connect to secured websphere server
JMX Admin client unable to connect to secured Websphere server