File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Oracle 9i on Tomcat5 JNDI configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Oracle 9i on Tomcat5 JNDI configuration" Watch "Oracle 9i on Tomcat5 JNDI configuration" New topic
Author

Oracle 9i on Tomcat5 JNDI configuration

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi there,
I'm have an understanding problem, who wants to enlighen me:
- build a small servlet that retrieved data from an Oracle database using Oracles OCI driver. In the process I learned to put the ojndi14.jar into the common\lib directory.
- then I got the idea to move the stuff to JNDI. So I created a global data source in Tomcat (I used the Tomcat admin web interface, since I find the xml rather confusing). I named the JNDI "jdbc/umsys". When I try to resolve the name with a context I get an error that the name could not be resolved.
So I miss something out (I presume). What could that be? (I restarted the whole machine).
;-) stw

P.S.:
What I coded:
here I get the error:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

I had a look into the server.xml and found:


[ May 29, 2004: Message edited by: Stephan Wissel ]
[ Mike Curwen - edited server.xml snippet to use code tags and show only relevant portion. ]
[ May 29, 2004: Message edited by: Mike Curwen ]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

you're probably missing the resource link.

I'm not a big fan of global resources, and always use context-specific datasources. But if you want to go the global route, you need to link it to each context in which you want to use it. The 'global' in the name is slightly misleading in that it's not globally configured for all apps. It's more like it's globally 'available' to be used, but not until it's configured locally.

Read the *very* bottom of
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Originally posted by Mike Curwen:
you're probably missing the resource link.

I'm not a big fan of global resources, and always use context-specific datasources.

Hi Mike, yup I missed the one with the resource link. Since I'm brand new to the Tomcat, I gotta bit confused about global and context stuff. So I'll follow that advice and move the database into the context.
Thx a lot!
;-) stw
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle 9i on Tomcat5 JNDI configuration