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_TYPE,
AdminClient.CONNECTOR_TYPE_SOAP);
connectProps.setProperty(AdminClient.CONNECTOR_HOST, "localhost");
connectProps.setProperty(AdminClient.CONNECTOR_PORT, "8881");
connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true");
connectProps.setProperty(AdminClient.CONNECTOR_SOAP_CONFIG, "file//C:\\Program files\\IBM\\SDP70\\runtimes\\base_v6\\profiles\\AjayProfile\\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.ConnectorException: 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.createAdminClient(AdminClientFactory.java:359)
at Test.main(Test.java:32)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:300)
... 1 more
Caused by: com.ibm.websphere.management.exception.ConnectorNotAvailableException
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:253)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.<init>(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.SOAPConnectorClient$2.run(SOAPConnectorClient.java:236)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:233)
... 7 more
---- Begin backtrace for nested exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:300)
at Test.main(Test.java:32)
Caused by: com.ibm.websphere.management.exception.ConnectorNotAvailableException
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:253)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.<init>(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.SOAPConnectorClient$2.run(SOAPConnectorClient.java:236)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at com.ibm.ws.management.connector.soap.SOAPConnectorClient.reconnect(SOAPConnectorClient.java:233)
... 7 more
Exception creating admin client: com.ibm.websphere.management.exception.ConnectorException: 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
<wasInstallRoot>/plugins/com.ibm.ws.security.crypto_6.1.0.jar
Ken
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"
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_TYPE,
AdminClient.CONNECTOR_TYPE_SOAP);
connectProps.setProperty(AdminClient.CONNECTOR_HOST,
"localhost");
connectProps.setProperty(AdminClient.CONNECTOR_PORT, "8880");
connectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED,
"true");
connectProps.setProperty(AdminClient.USERNAME, "<<Replace this
with the WAS Admin user name >>");
connectProps.setProperty(AdminClient.PASSWORD, "<<Replace this
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