« Just a test | Main | Porting from Tomcat to OC4J, Part III: Correct Use of Quotes »

Porting from Tomcat to OC4J, Part II: JNDI names

The second comment on my previous post provoked an answer.

In OC4J you have the ability to use a number of different JNDI context factories. Each of them helps to create an InitialContext and comes with different functionalities.

The most commonly used context factories are:

  • internal context factory - you get this one by simply calling the default constructor of InitialContext and don't have an jndi.properties in your class path and are within the OC4J container.
  • RMIInitialContextFactory - This one is commonly used to connect to the OC4J container. It ignores every configuration and also doesn't need the "java:comp/env/" prefix. (Here the second comment is true.)
  • ApplicationClientInitialContextFactory - This context factory takes care of your JNDI environment (esp. in META-INF/application-client.xml) and honor's the "java:comp/env/" environment prefix.
This is the flexibility of OC4J and it is up to you to use the right context factory in your application. Flexibility sometimes has a pay off, but I don't to start a thread on this. Some people love flexibility, eg. some Eclipse zealots...

On the upcoming posts, I'll cover the XML parser and Hivemind configuration issues (Hint: No need to change the source code...).

Stay tuned.

Comments (2)

Iris Peters:

I have seen in OC4J 10.1.3.1 that this is not the case anymore .

Am i right ?

Olaf Heimburger:

Will follow up on this shortly. Sorry for the delayed answer. --olaf

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on August 4, 2006 12:36 PM.

The previous post in this blog was Just a test.

The next post in this blog is Porting from Tomcat to OC4J, Part III: Correct Use of Quotes.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle