Configuring JNDI for a Single J2EE Process Execution Engine

The following procedure shows you how to configure your PAPI Java client to connect to a single J2EE Process Execution Engine running in a remote location, using JNDI.
To configure the JNDI properties you need to access a remote J2EE Process Engine from your PAPI client:
  1. Create a properties file that contains the JNDI properties PAPI needs to connect to the remote J2EE Process Engine. You must specify the following basic properties:
    • java.naming.factory.initial
    • java.naming.provider.url
    Note: If your remote server needs additional properties to connect using JNDI, specify this properties as well.
  2. Copy this file to a location that is accessible to your PAPI Client.
  3. Provide the PAPI client access to the file that contains the JNDI properties. You can set this property in the code of the PAPI client using system properties, or you can pass it as an argument using the -D option of the java command.
    Property Description
    fuego.j2ee.initialctx.file Specifies the name of file that contains the JNDI properties to connect to the application server where the specified J2EE Process Engine runs. You must specify the value of this property using the absolute path of the file.
    fuego.j2ee.initialctx.resource Specifies the name of the resource that contains the JNDI properties to connect to the application server where the specified J2EE Process Engine runs. PAPI obtains the resource using the method getResource() of the context ClassLoader. You must add this resource to the CLASSPATH.
    fuego.j2ee.initialctx.url The URL of the file that contains the jndi properties to connect to the application server where J2EE Process Engine runs.
The following example shows you how to specify the file that contains the jndi properties to connect to the server where the default J2EE Process Engine runs, using the property fuego.j2ee.initialctx.file.
  • Using system properties in the Java code of the PAPI client:

    System.setProperty("fuego.j2ee.initialctx.file", "C:\\engine.properties");

  • Using the option -D when running the PAPI client:

    java -Dfuego.j2ee.initialctx.file=C:\\engine.properties

The following example shows you how to specify the resource that contains the jndi properties to connect to the server where the default J2EE Process Engine runs, using the property fuego.j2ee.initialctx.resource.
  • Using system properties in the Java code of the PAPI client:

    System.setProperty("fuego.j2ee.initialctx.resource", "engine.properties");

  • Using the option -D when running the PAPI client:

    java -Dfuego.j2ee.initialctx.resource=engine.properties

The following example shows you how to specify the URL that contains the jndi properties to connect to the server where the default J2EE Process Engine runs, using the property fuego.j2ee.initialctx.url.
  • Using system properties in the Java code of the PAPI client:

    System.setProperty("fuego.j2ee.initialctx.url", "http://server/conf/engine.properties");

  • Using the option -D when running the PAPI client:

    java -Dfuego.j2ee.initialctx.url=http://server/conf/engine.properties