Configure Service Locator

ServiceLocator is configured by properties passed to the getInstance factory method. Three types of properties can be configured: JNDI properties, client mode, and authentication properties. The following table lists typical configuration parameters and their possible values. JNDI parameter values are used with an Oracle Application Service JNDI client library:

Service Locator Configuration Properties

Property Name

Description

Values

javax.naming.Context.INITIAL_CONTEXT_FACTORY

Specifies the factory class used to instantiate context factory that is required by JNDI to establish initial connection.

For remote mode: "weblogic.jndi.WLInitialContextFactory"; not required in local mode.

javax.naming.Context.PROVIDER_URL

Specifies the location of the JNDI context containing HDR bean bindings.

For remote mode: "t3://hostname:port" where "hostname" is the host running HDR and port is the WebLogic admin port configured for the Application Service; not required in local mode.

javax.naming.Context.SECURITY_PRINCIPAL

Specifies the JNDI principal; is set by ServiceLocator.login when a session is created.

When creating a ServiceLocator for an existing session, the value must be identical to the username passed to ServiceLocator.login when the session was established.

javax.naming.Context.SECURITY_CREDENTIALS

Specifies the JNDI credential; is set by ServiceLocator.login when a session is created.

When creating a ServiceLocator for an existing session, the value must be identical to the password passed to ServiceLocator.login when the session was established.

ServiceLocator.CLIENT_MODE

Specifies whether the ServiceLocator should attempt to connect to Remote or Locale EJBs

ServiceLocator.REMOTE or ServiceLocator.LOCAL. The default is ServiceLocator.REMOTE.

JNDI properties (named in table, with names starting with javax.naming.Context) can be configured by Java System properties, a jndi.properties file in the classpath, or by setting the values programmatically on the Properties passed to ServiceLocator.getInstance. The order of precedence is that programmatic properties override jndi file properties that in turn override Java System properties. We recommend that you always configure javax.naming.Context.INTIAL_CONTEXT_FACTORY and javax.naming.Context.PROVIDER_URL using Java System properties or jndi.properties to avoid unexpected behavior, and the need for extra configuration in your application code. You should configure the remaining configuration options on the Properties object that you pass to ServiceLocator.getInstance.

Note:

Always configure javax.naming.Context.INTIAL_CONTEXT_FACTORY and javax.naming.Context.PROVIDER_URL implicitly using jndi.properties or other Java System properties. Please refer to your Application Service documentation for more information.