javax.naming.NameNotFound exception with db connection pool
SummaryExternal 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.
The DataSourcejdbc/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 ReproduceCreate a Database instance using JDBC Datasource setting JNDI name jdbc/your_db.
Root CauseA third-party product issue.
This is the incorrect specification for the database JNDI name.
ResolutionMake 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