Here’s your don’t-waste-hours-on-something-silly-that-I-did tip for the day.
I recently had the opportunity to change an existing in-house web application from running under Tomcat 5.5, to Glassfish v2. The application uses JDBC connection pooling in the application server, and uses JNDI to find the pool. The only stumbling block I encountered was that, immediately after deploying the application, Hibernate would always complain that it couldn’t find the connection:
1 2 3 4 5 6 7 8 9 10 11
As it turns out, the datasource that I was using in hibernate.cfg.xml was perfectly fine for Tomcat, but not for Glassfish. I had put the fully qualified JNDI file in my config file:
Glassfish doesn’t like that. Once I changed it to:
Everything worked swimmingly.