This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Name jdbc is not bound in this Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Name jdbc is not bound in this Context" Watch "Name jdbc is not bound in this Context" New topic
Author

Name jdbc is not bound in this Context

jaan bhavsar
Ranch Hand

Joined: Aug 23, 2008
Posts: 32
Hi to all Ranchers,
I am making connection pool with tomcat.i define necessary entry in server.xml,web.xml and made one listener class to get the connection.but i am getting error "javax.naming.NameNotFoundException:Name jdbc is not bound in this Context" when i start the tomcat server.and also in my listener value of dataSourcejndi name is displayed null.

is there any jar files need to put in tomcat common/lib,i put mysql connector and odbc14.jar .


Please guide me how to get the jndidatasource name in listener .I attached three files for your reference in single file.
1)web.xml
2)server.xml
3)Applistener.java

1)web.xml


2)Server.xml(in tomcat)


3)Listener Class to get the jndidatasource name
i am getting the jndiname null
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hi,
Access the Datasource using "java:comp/env/jdbc/test".

Regards,
Amit
jaan bhavsar
Ranch Hand

Joined: Aug 23, 2008
Posts: 32
Thanks amit. I done that and its working good
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Name jdbc is not bound in this Context
 
Similar Threads
Configure tomcat resource factory
Pooling w/Tomcat 5 - Oracle
javax.naming.NamingException- Cannot create resource instance
Tomcat Database Connection Pooling Error
javax naming name not found exception jndi in struts2.0