AMStoreConnection does not find some classes. Please help!!!
I am onWindows, play withstandalone non-web based command line samples. SSO works fine, but I cannot instantiate AMStoreConnection Java app. It cannot find some classes.
Exception in thread "main" java.lang.NoClassDefFoundError at com.iplanet.am.sdk.AMStoreConnection.<clinit>(AMStoreConnection.java:146)
I suspect that it tries to load some native DLLs for jss/nss. I have
set LD_LIBRARY_PATH=D:\sun\share\lib;D:\sun\Server-Root\lib;D:\sun\Server-Root\lib\ jss
in my bat file but it does not help.
Can somebody post a WORKING bat file how to setup env variables, classpath and Xbootclasspath on Windows. Again, this is for stand alone command line Java program. Servlet samples seem to be working properly.
[767 byte] By [
Glen-Ta] at [2007-11-26 13:56:41]

# 2
hi,
firstly, the CommandLineSSO file needs a SSOToken argument when you run from cmd prompt. where are you getting this from? if using mozilla browser, you can login to your amconsole and then open cookies, look out for iPlanetDirectoryPro cookie from Tools->options->open cookies (search for say test.com if dc=test,dc=com is ur domain), but that SSOToken wld be URL encode. you need to edit your commandlinesso class to use something like
SSOToken token = manager.createSSOToken(URLDecoder.decode(args[0],"UTF-8"));
if you dont want to go thru this, you can simple test with SDKCommandLineSSO editing ur batch file exec at the end.
try with the batch file below:
set BASE_DIR=C:\Sun
set JSS_JAR_PATH=C:\Sun\share\lib
set JAVA_HOME=C:\Java\JDK15~1.0_0
set JAVA_EXEC=%JAVA_HOME%\bin\java
set PATH=%PATH%;c:\Sun\AccessManager\Config
set PRODUCT_DIR=%BASE_DIR%\AccessManager
setlocal
set
CLASSPATH=.;%BASE_DIR%\AccessManager\config;%BASE_DIR%\AccessManager\lib\am_log ging.jar;%BASE_DIR%\AccessManager\lib\sax.j
ar;%BASE_DIR%\AccessManager\lib\jaxp-api.jar;%BASE_DIR%\AccessManager\lib\dom.j ar;%JSS_JAR_PATH%\jss4.jar;%BASE_DIR%\Acces
sManager\lib\servlet.jar;%BASE_DIR%\AccessManager\lib\am_services.jar;%BASE_DIR %\AccessManager\lib\am_sdk.jar;%BASE_DIR%\A
ccessManager\locale;%JSS_JAR_PATH%\ldapjdk.jar
echo %CLASSPATH%
%JAVA_EXEC% -D"java.protocol.handler.pkgs=com.iplanet.services.comm"
-D"com.iplanet.coreservices.configpath=%BASE_DIR%\config" -classpath %CLASSPATH% CommandLineSSO %*
endlocal
# 4
Well It works now.
The solution was a corret AMConfig File. as follows
com.iplanet.services.debug.level=error
com.iplanet.services.debug.directory=C:/Sun/AccessManager/debug
/*
* Naming URL
*/
com.iplanet.am.naming.url= -- write a correct URL here --
/*
* Notification URL
*/
com.iplanet.am.notification.url=-- write a correct URL here --
/*
* Security Credentails to read the configuration data
*/
com.sun.identity.agents.app.username=amAdmin
com.iplanet.am.service.password= -- enter amadmin user password --
com.iplanet.am.service.secret=ENCRYPTED_SERVICE_SECRET
/*
* Encryption key that will be used to encrypt and decypt
* password. This key is needed to decrypt passwords stored
* in the configuration, and also to decrypt the secret.
*/
am.encryption.pwd=ENCRYPTION_PASSWORD
/*
* Property to set JCE as the default encryption classes
*/
com.iplanet.security.encryptor=com.iplanet.services.util.JCEEncryption
/*
* Cache update time (in minutes) for user management cache,
* if notification URL is not provided
*/
com.iplanet.am.sdk.remote.pollingTime=1
/*
* Cache update time (in minutes) for service configutation data,
* if notification URL is not provided
*/
com.sun.identity.sm.cacheTime=1
/*
* Server protocol, host and port to be used for SAML service
*/
com.iplanet.am.server.protocol=http
com.iplanet.am.server.host= -- write host name fully quilified --
com.iplanet.am.server.port=80
com.iplanet.am.cookie.name=iPlanetDirectoryPro
com.iplanet.am.cookie.secure=false
com.iplanet.am.cookie.encode=false
com.iplanet.am.services.deploymentDescriptor=/amserver
com.iplanet.am.version=7
/*
* Identify cert db directory path, prefix and password file
* to initialize JSS Socket Factory when Web Container is configured SSL
*/
com.iplanet.am.admin.cli.certdb.dir=CONTAINER_CERTDB_DIR
com.iplanet.am.admin.cli.certdb.prefix=CONTAINER_CERTDB_PREFIX
com.iplanet.am.admin.cli.certdb.passfile=BASEDIR/PRODUCT_DIR/config/.wtpass
Only include servelt.jat and amclientsdk.jar in your classpath and it worked fine for me