How do I run the SDK example smjavaagentapi with a 4.x agent

Document ID : KB000095728
Last Modified Date : 06/06/2018
Show Technical Document Details
Question:
Compile and run example "CA/sdk/samples64/smjavaagentapi"

messages:

4.x Agent Interface" FATAL: Failed trying to connect to the Policy Server. Ensure that the Agent Name and Shared Secret in smjsdkexample.properties matches that of a pre-existing agent in the Policy Store. -

Could you please provide documentation or some kind of implementation/configuration guide to successfully run the SDK example to connect to the policy server?
Answer:

To run the SDK Agent sample correctly you need to do the following:

4.x Agent Model:

1) You will need to setup a 4.x agent on the Policy Server.
    Create Agent in WAMUI
    Select "Supports 4.x agents"
    Enter Agent name as "jsdksample-agent"
    Enter IP Address (can be 127.0.0.1)
    Enter Shared Secret Password

2) Enter above values into smjsdkexample.properties
    Change AGENT_SECRET and AGENT_IP to have the values you entered.

3) Enter the Policy Server values into smjsdkexample.properties
    Find PS_IP and enter the IP address or FQDN of the Policy Server you want to connect to.

You should now be able to at least make a connection to the Policy server with the SDK