Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.1.0) Part Number B28221-02 |
|
|
View PDF |
If the client is collocated with the target, the client exists within the same application as the target, or the target exists within its parent, then you do not need to initialize JNDI properties. Otherwise, you must initialize JNDI properties in one of the following ways:
This section describes the following:
For more information, see the following:
You can set JNDI properties in a file named jndi.properties
that conforms to the requirements specified in the java.util.Properties
method load
.
Set JNDI properties as follows:
<PropertyName>=<PropertyValue>
For example:
java.naming.factory.initial= oracle.j2ee.server.ApplicationClientInitialContextFactory
For property names, see the field definitions in javax.naming.Context
.
For an example, see "Specifying Credentials in JNDI Properties".
If setting the JNDI properties within the jndi.properties
file, make sure that this file is accessible from the client CLASSPATH
, or specified in ejb-ref-mapping
attribute jndi-properties-file
in the appropriate the OC4J-proprietary deployment XML file (see "Configuring an Environment Reference to a Remote EJB: Unclustered Separate Web Tier and EJB Tier").
You can set JNDI properties as system properties specified either on the command line as a -D
argument or as an environment reference (see "Configuring an Environment Reference to an Environment Variable").
You can set JNDI properties by creating a HashTable
and populating it with the required properties using javax.naming.Context
fields as keys and String
objects as values. When you instantiate the initial context, pass the HashTable
into the the initial context constructor.
For an example, see "Specifying Credentials in the Initial Context".