Support Article
javax.naming.NameNotFound exception with db connection pool
Summary
External database integration using connection pool configuration in Tomcat app server fails.
The following error is in the log during test connection from the database configuration rule.
Error Messages
The DataSource jdbc/your_db is invalid: Unable to obtain DataSource object: code: <none> SQLState: Name [jdbc/your_db ] is not bound in this Context. Unable to find [jdbc]. Message: <none>
DatabaseException caused by prior exception: javax.naming.NameNotFoundException: Name [jdbc/your_db ] is not bound in this Context. Unable to find [jdbc].
Steps to Reproduce
Create a Database instance using JDBC Datasource setting JNDI name jdbc/your_db.
Root Cause
A third-party product issue.
This is the incorrect specification for the database JNDI name.
Resolution
Make the following change to the operating environment:
The JNDI name should be java:/comp/env/jdbc/your_db.
See the Tomcat documentation on jndi-datasource-examples-howto.
Published August 7, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.