• 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

WAS 6.1 JMX AdminClient.

 
Greenhorn
Posts: 20
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:


com.ibm.SOAP.securityEnabled=false
com.ibm.SOAP.loginUserid=
com.ibm.SOAP.loginPassword=



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
Greenhorn
Posts: 20
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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.
Cheers

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