000026496 - How do I build and run the Java examples in Authentication Manager 7.1

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 3Show Document
  • View in full screen mode

Article Content

Article Number000026496
Applies ToAuthentication Manager 7.1 SDK
IssueHow do I build and run the Java examples in Authentication Manager 7.1
java.io.StreamCorruptedException: invalid type code: 31
java.lang.UnsupportedClassVersionError: unsupported classversion 50.0

1. If installing on a remote machine (not the Primary Authentication Manager) download Sun Java JDK 1.5 from http://java.sun.com/javase/downloads/index_jdk5.jsp and install it. Note that Java 1.6 is not compatible with the server, so you need to use 1.5 to avoid getting one of the following build errors:

java.io.StreamCorruptedException: invalid type code: 31

java.lang.UnsupportedClassVersionError: unsupported classversion 50.0

I'd strongly recommend starting you configuration on the Primary, that way you can just copy everything to the remote machine and you can just use the installed Java to eliminate any incompatibilities. Either way you need to setup your environmental variables. For example:

JAVA_HOME = c:\Program Files\RSA Security\RSA Authentication Manager\appserver\jdk


Test your configuration by running "java -version" while your pwd is outside of the jdk/bin directory. You should see:

java version "1.5.0_12"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)

BEA JRockit(R) (build R27.4.0-90-89592-1.5.0_12-20070928-1715-windows-ia32, compiled mode)


2. Download Apache Ant from http://ant.apache.org/ and install it. We provide build.xml files with the samples that will simplify the build and excution using Ant. In my example I renamed my ant_version directory to simply "ant".

a. Extract the files from the compressed image

b. Set environmental variables:



Test your configuration by typing "ant" while your pwd is outside of the ant\bin directory. You should get the following error:

Buildfile: build.xml does not exist!

Build failed

3. Download the SDK from https://knowledge.rsasecurity.com/scolcms/set.aspx?id=8205 Extract the files into a convenient directory. In my example I use the Authentication Manager home directory. To simplify things lets sets a couple more variables:

RSA_AM_HOME = C:\Program Files\RSA Security\RSA Authentication Manager


Open up the Dev Guide located in %SDK_HOME%\docs\guide\auth_manager_developer_guide.html, click the getting started then setting java system properties links. Use this to follow along on the next steps.

4. Create a new wlfullclient. Note that this step MUST be done with the 1.5 java otherwise you will errors later. (see step 1 for the errors)

cd %RSA_AM_HOME%\appserver\weblogic\server\lib

java -jar ..\..\..\modules\com.bea.core.jarbuilder_1.0.0.0.jar -profile wlfullclient

5. Copy the following files into your %SDK_HOME%\lib\java directory









6. To be able to connect to the server remotely we need to import the root certificate from the server. Substitute am71server.jks with the name of your file. (check your server)


%JAVA_HOME%\jre\bin\keytool -export -keystore %RSA_AM_HOME%\server\security\am71server.jks -file am_root.cer -alias rsa_am_ca

When prompted for a password just hit enter.


%JAVA_HOME%\jre\bin\keytool -import -keystore %sdk_home%\lib\java\trust.jks -storepass changeit -file am_root.cer -alias rsa_am_ca -trustcacerts

Note that "changeit" is the default password for the keystore.

7. Obtain the credentials needed to connect to the server.

%RSA_AM_HOME%\utils\rsautil manage-secrets -a list

You should see something like:


Command Client User Name .................: CmdClient_vKr9aLK9
Command Client User Password .............: e9SHbK0W4i

8. Find the sample that you want to run and modify the config.properties file. I'm using the admin sample.

cd %SDK_HOME%\samples\admin

Open up the config.properties file and edit the following fields:

java.naming.provider.url = t3s://bburdzel-vmbox1.na.rsa.net:7002

# User ID for process-level authentication.

com.rsa.cmdclient.user = CmdClient_vKr9aLK9

# Password for process-level authentication

com.rsa.cmdclient.user.password = e9SHbK0W4i

# Provider URL for Two-Way SSL client authentication

ims.ssl.client.provider.url = t3s://am71server.domain.com:7022

# Identity keystore for Two-Way SSL client authentication

ims.ssl.client.identity.keystore.filename = am71server.jks

# Identity keystore private key alias for Two-Way SSL client authentication

ims.ssl.client.identity.key.alias = am71server

# Identity keystore trusted root CA certificate alias

ims.ssl.client.root.ca.alias = rsa_am_ca

# SOAPCommandTargetBasicAuth provider URL

ims.soap.client.provider.url = https://am71server.domain.com:7002/ims-ws/services/CommandServer

9. Double check the build.xml file to make sure all the paths are correct. If you are getting class def errors its likely the following line:

<property name="libdir" value="${basedir}/../../lib/java"/>

10. Build the project. From the directory that contains the build.xml file, just type "ant".

11. Run it. Just type "ant run-create".  For details on additional arguments take a look in the build.xml.

Now that everything is working on the primary you should be able to just copy everything in %SDK_HOME% over to a remote machine and set your variables.

Legacy Article IDa41160