000013749 - Failed to construct CommandTarget

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

Article Content

Article Number000013749
Applies ToRSA Authentication Manager 7.1
SDK
API
Issuecom.rsa.common.SystemException: Failed to construct CommandTarget
       at com.rsa.command.ConnectionFactory.getConnection(ConnectionFactory.java:265)
       at com.emc.rsa.mjbond.am71.TestProg.main(TestProg.java:728)
Caused by: java.lang.IllegalArgumentException: Container name X is not supported
       at com.rsa.command.InitialContextFactoryLocator.getInitialContextFactory(InitialContextFactoryLocator.java:66)
       at com.rsa.command.EJBRemoteTarget.<init>(EJBRemoteTarget.java:177)
       at com.rsa.command.ConnectionFactory.getConnection(ConnectionFactory.java:262)
Failed to construct CommandTarget
Cause

The code which generates this is as follows:

      Properties propsA = new Properties();
      propsA.setProperty("CONTAINER_NAME", "X");
      propsA.setProperty(Context.PROVIDER_URL, "t3s://am71server.rsa.net:7002");
      propsA.setProperty(Context.SECURITY_PRINCIPAL,"CmdClient_fohlgidk");
      propsA.setProperty(Context.SECURITY_CREDENTIALS,"A6GJoThyRh");
      propsA.setProperty(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

      conn= ConnectionFactory.getConnection(propsA);

The problem is that the property CONTAINER_NAME must not be included in the parameters passed into the connection factory.

Resolution

When using a Properties object passed as a parameter into ConnectionFactory you must include only the required parameters and no others, the correct code is as follows:

      Properties propsA = new Properties();
      propsA.setProperty(Context.PROVIDER_URL, "t3s://am71server.rsa.net:7002");
      propsA.setProperty(Context.SECURITY_PRINCIPAL,"CmdClient_fohlgidk");
      propsA.setProperty(Context.SECURITY_CREDENTIALS,"A6GJoThyRh");
      propsA.setProperty(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

      conn= ConnectionFactory.getConnection(propsA);

Legacy Article IDa58500

Attachments

    Outcomes