This is an error when the SiteMinder SDK agent is trying to establish connection to Policy Server and fail.
This article is to provide basic steps on how to test the SDK agent so it can connect to Policy Server using "smjavaagentapi" included in SiteMinder SDK.
Audience: This is for advanced SiteMinder users and developers.
Installed SiteMinder SDK R12.8.6a version on Windows 10.
JDK 11.0.20.1+1 installed and its bin folder set in %PATH%
If using very old version of JDK then JCE patch must be applied.
"<SDK Install folder>/samples/smjavaagentapi/JavaTestClient.java" has the following that you must pay attention to.
public class JavaTestClient // Resource bundle (smjsdksample.properties) private String clientIPAddr = null; |
"BUNDLE_NAME" is the file name (with properties extension) which this program will read the parameters from.
Scanner reader = new Scanner (System.in); String agentIP = getStringFromBundleWithTrim("AGENT_IP"); AgentAPI agentapi = new AgentAPI(); |
As you can see this program is fetching the highlighted parameters from the "smjsdksample.properties"
Open "<SDK Install folder>/properties/smjsdksample.properties" in text editor and update the following information.
AGENT_IP = 192.168.0.122
PS_IP = 192.168.0.123
OBJNAME_PREFIX = jsdksample- |
Note that the sample program did not read "AGENT_NAME" from the smjsdksample.properties" file but instead it is reading "OBJNAME_PREFIX" and appending "agent" to it.
This makes the agentname "jsdksample-agent"
This means you have a Policy Server running on IP 192.168.0.123 and the SDK is installed on IP 192.168.0.122
You have created a 4.x agent manually with following information:
1. Agent Name: jsdksample-agent
2. Shared Secret: {secret}
3. Agent IP: 192.168.0.122
Run the "java-build.bat" and "java-run.bat".
Enter "1" when asked for Agent Type.
C:\SDK\samples\smjavaagentapi>java -Djava.library.path=..\..\bin -classpath .;..\..\properties;..\..\java\smjavasdk2.jar;..\..\java\smjavaagentapi.jar JavaTestClient Welcome to the Interactive FTP Server ------------------------------------- Do you want to connect through: (1) 4.x Agent Interface (2) 5.x Agent Interface(smreghost utility must be run before it) ------------------------------------- Enter the Agent type(1/2) to connect:
Policy Server IP Address.................: 192.168.0.123
DoManagement (SET_AGENT_INSTANCE_INFO)...: 1 (YES)
DoManagement (GET_AGENT_COMMANDS)........: 1 (YES)
Resource Name............................: /resfilter/private.html
UnInit...................................: 0 (SUCCESS) >>>>>>>>>>>>>>>>>>>>>>>>>>>> End <<<<<<<<<<<<<<<<<<<<<<<<<<< |
Sample program is using "jsdksample-agent" and its sharedsecret to communicate with Policy Server but if the matching agentname is not found in the policy store then the error will be displayed.
C:\SDK\samples\smjavaagentapi>java -Djava.library.path=..\..\bin -classpath .;..\..\properties;..\..\java\smjavasdk2.jar;..\..\java\smjavaagentapi.jar JavaTestClient Welcome to the Interactive FTP Server ------------------------------------- Do you want to connect through: (1) 4.x Agent Interface (2) 5.x Agent Interface(smreghost utility must be run before it) ------------------------------------- Enter the Agent type(1/2) to connect:
Policy Server IP Address.................: 192.168.0.123 |