Registering tokens across HTTPS
I am currently working with an application that registers client token identifiers with their HTTPS based servers. Unfortunately I seem to be encountering errors that I cannot find solutions to. When I execute my application I get the following error:
Exception in thread"main" java.lang.NoClassDefFoundError
at javax.crypto.Cipher.getInstance(DashoA12275)
at com.sun.net.ssl.internal.ssl.JsseJce.getCipher(Unknown Source)
at com.sun.net.ssl.internal.ssl.RSACipher.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.RSACipher.getInstance(Unknown Source)
at com.sun.net.ssl.internal.ssl.PreMasterSecret.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
at com.iplanet.services.comm.client.PLLClient.send(PLLClient.java:113)
at com.iplanet.services.comm.client.PLLClient.send(PLLClient.java:71)
at com.iplanet.services.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:335)
at com.iplanet.services.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:308)
at com.iplanet.services.naming.WebtopNaming.getServerFromID(WebtopNaming.java:245)
at com.iplanet.dpro.session.SessionID.parseServerID(SessionID.java:368)
at com.iplanet.dpro.session.SessionID.parseSessionString(SessionID.java:318)
at com.iplanet.dpro.session.SessionID.getSessionServerProtocol(SessionID.java:174)
at com.iplanet.dpro.session.Session.getSessionServiceURL(Session.java:755)
at com.iplanet.dpro.session.Session.getSession(Session.java:625)
at com.iplanet.sso.providers.dpro.SSOProviderImpl.createSSOToken(SSOProviderImpl.java:147)
at com.iplanet.sso.SSOTokenManager.createSSOToken(SSOTokenManager.java:296)
at SSOTokenRegister.main(SSOTokenRegister.java:61)
The code I am executing agasint the API to get this error is fairly simple:
//create instance of token manager
SSOTokenManager manager = SSOTokenManager.getInstance();
//register
SSOToken token = manager.createSSOToken(tokenId);
The following is the contents of my is61sdkwin32\lib\AMConfig.properties file:
com.iplanet.services.debug.level=message
com.iplanet.services.debug.directory=C:/Path/To/Logs/
com.iplanet.am.naming.url=https://3rd.party.url.com/amserver/namingservice
com.iplanet.am.version=6.1
com.sun.identity.webcontainer=IAS7.0
com.iplanet.am.notification.url=http://client.listener.url.com:3700/listener
com.iplanet.am.naming.ignoreNamingService=true
com.iplanet.am.server.protocol=https
com.iplanet.am.server.host=3rd.party.url.com
com.iplanet.am.server.port=443
com.iplanet.am.jssproxy.trustAllServerCerts=true
I am executing my application with the following batch file
SET TOKEN_TO_REGISTER=%1
::Store current environment vars
set OLD_PATH=%PATH%
set OLD_CLASSPATH=%CLASSPATH%
::Set runtime directory environment vars
set BASE=C:\Path\To\Sdk\is61sdkwin32
set BASE_CLASS_DIR=.
set LIB_DIR=%BASE%\lib
::Set runtime environment vars
set IS_CLASSPATH=.
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%
SET IS_CLASSPATH=%IS_CLASSPATH%;%BASE%\locale
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\jaas.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\am_services.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\am_sdk.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\jss311.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\servlet.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\iaik_ssl.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\crimson.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%LIB_DIR%\am_logging.jar
SET IS_CLASSPATH=%IS_CLASSPATH%;%BASE%\is61sdkwin32\dtd
set PATH=%BASE%\lib;%LIB_DIR%\jss;%OLD_PATH%
set CLASSPATH=%IS_CLASSPATH%;C:\Progra~1\Java\jre1.5.0_06\lib\tools.jar;C:\Progra~1\Java\jre1.5.0_06\lib\jce.jar
::Execute
C:\Progra~1\Java\jre1.5.0_06\bin\java -classpath %CLASSPATH% SSOTokenRegister %TOKEN_TO_REGISTER%
::Reset environment vars
set PATH=%OLD_PATH%
set CLASSPATH=%OLD_CLASSPATH%
Initially I assume that this was an issue with the CLASSPATH, however this seems not to be the case.
I am 100% certain the remote servers are not the issue, as other non java based applications function correctly. However these do not use the SUN API so I am beginning to believe that the issue lies in either how I execute the application (i.e. CLASSPATH) or how I have configured the application via the AMConfig.properties file.
Can anybody shed any light on this?

