File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes javax.naming.NamingException- Cannot create resource instance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

javax.naming.NamingException- Cannot create resource instance

Ravikumar Jambunathan
Ranch Hand

Joined: Aug 25, 2003
Posts: 66
while i am trying to connect oracle database thru JNDI, i am getting this exception.The oracle jdbc driver is availavle in %CATALINA-HOME/common/lib as well as in my application context directory under WEB-INF(/lib).
I have given below my codings for reference.
This is my context in server.xml.
<!-- MyServlets Context-->
<Context path="/MyServlets" docBase="MyServlets" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_MyServlets_log." suffix=".txt"
<Resource name="jdbc/test" auth="Container"
<ResourceParams name="jdbc/test">
<value>jdbc racle:thin:@localhost:1521:test</value></parameter>
<!-- End of MyServlets Context -->
My application web.xml.
and this is my JDBC connection part of my code,

InitialContext ctx= new InitialContext();
DataSource ds=(DataSource) ctx.lookup("java:comp/env/jdbc/test");
anybody could help me out to solve this problem?.
thanks in advance.
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
Did you rename the driver lib from .zip to .jar? Tomcat will only load .jar files.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Ravikumar Jambunathan
Ranch Hand

Joined: Aug 25, 2003
Posts: 66
thanks carl, yes i have already done it.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

The same question has been asked in the EJB and J2EE forum.
Anyone who wants to help should go HERE.
Ravikumar Jambunathan,
Please don't post the same question in multiple forums, it creates duplicate conversations and wastes the time of those who are trying to help you. I'm going to ask for this thread to be closed.
I agree. Here's the link:
subject: javax.naming.NamingException- Cannot create resource instance
It's not a secret anymore!