- Java 1.7
- Hibernate 4
- Tomcat 7
- MySQL
Hibernate declares quite plainly that developers should avoid using its own connection pooling implementation for production systems. The dearth of good documentation could paper a welcome mat. Tomcat doesnt do much better.
What's more, if you're using Eclipse to build the application and you want to debug on a tomcat server, how do you connect to MySQL without using Hibernate's connection pooling in hibernate.cfg.xml? I cant provide the entire answer, but here's an important point for configuration:
The tomcat server in your Eclipse IDE has its own context.xml. This is the file where you identify the database and its credentials to use by your applications. If you assumed that the context.xml file located in your application's META-INF would be exercised, you'd be dead wrong.
Apparently, when you run your app in Eclipse, the attached Tomcat server only recognizes the context.xml file it has, and it ignores the one in the application. Painful.
So do yourself a favor and add your database connection information into the server's context.xml file or feel the wrath of "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'".

No comments:
Post a Comment