• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' (Hibernate + Seam)

 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK now I'm totally baffled. I had been successfully using Tomcat 6 with a single datasource defined in the webapp's context for some time. Then I ported the webapp to JBoss AS 6.0. When I switched my config back to Tomcat suddenly I got an exception when starting the server (along with my Hibernate/Seam webapp):

Note I'm using JBoss Seam (SeamListener in WEB-INF/web.xml) as configured here:
http://seamframework.org/Documentation/RunningASeamgenProjectOnApacheTomcatWithoutEmbeddedJBoss

context.xml:persistence.xml:components.xml:
web.xml:
I put the MySQL Connector JAR into tomcat/lib, which seems to be correct. Hibernate, its dependencies, JSF, Facelets, and Seam JARs were copied into the webapp lib dir later ending up in the deployed webapp's dir /WEB-INF/lib. persistence.xml ends up in /WEB-INF/classes/META-INF, context.xml in /META-INF. It all appears to be correct.

The strange thing about the Tomcat startup output is that even though this exception is thrown, I can still use the webapp without any problems, either through my HttpServlet or the FacesServlet.

Another strange observation I made is that whenever I change and save the webapp's web.xml in Eclipse using WTP (it triggers an automatic server restart) then no such an exception occurrs at all!

Really strange. But it hints that there is a very specific issue with Tomcat and the context datasource. Could it be Hibernate (doubts...)?

Do you have any ideas what could be wrong?

Karsten

PS: Maybe this is too complex to solve as anyone can only speculate about the problem here. Probably the final argument to drop Tomcat entirely and move on to JBoss...
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try in context.xml:

>
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the jdbc prefix in persistence.xml and web.xml, too? IIRC the jdbc thing isn't necessary. It's just a convention.

Karsten
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, just tried it with jdbc before the DS name, no changes.

Any other ideas?

Karsten
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it just does not see context.xml in /META-INF
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that could really be the case, but how do I check whether that file is picked up or not?

The next question would be why the webapp itself is working without the context.xml datasource. I happen to have a hibernate.properties in the same path as persistence.xml which I needed for JBoss Tools' HQL editor to specify the driver, URL etc. However, IIRC I've deleted that file from the server webapp dir, but there was no change. The DB can be accessed at all times. It's really strange. Maybe I should package my webapp and see if other can get it to work on their Tomcats (it's not a critical webapp). I'd probably have to switch from MySQL to HSQLDB and strip some data and classes. I'm pretty tired of trying...

Karsten
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, there's the line:



...

Karsten
 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've also tried the Context element in conf/server.xml (localhost Host element) to no avail. Always the very same exception. It's strange.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic