This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JNDI in webapps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI in webapps" Watch "JNDI in webapps" New topic

JNDI in webapps

Mike Jenkins
Ranch Hand

Joined: Jul 23, 2006
Posts: 57
I have JNDI working with my Oracle 9i database using my server.xml file in my local Tomcat 4.1.27. Now I need to put my webapp on the server and I wont get access or be able to touch server.xml on the server.

Please advise how I can get the JNDI to work without using server.xml. I tried putting the <context> info I had in server.xml into mywebappname root and call it mywebappname.xml and that didnt work. I also tried that with creating a context.xml and that didnt work. Both gave me back error message: Cannot create JDBC driver of class '' for connect URL 'null'

Is this something that can be done in Tomcat 4.1.27??

Here is what I have working in my server.xml that connects to Oracle databse with no problems:


database connection part

[ November 08, 2007: Message edited by: Mike Jenkins ]
Hongli Li
Ranch Hand

Joined: Oct 29, 2006
Posts: 124
You can create a META-INF folder right beside WEB-INF, inside which you create context.xml then add your configuration there. when you deploy it to tomcat, the file will be found at CATALINA_HOME/config/[engine]/[host]/, I used this technique, it works for me.

Do you know why this cup is useful? Because it is empty.
I agree. Here's the link:
subject: JNDI in webapps
It's not a secret anymore!