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...