I'm having a tough time getting Hibernate to work with JBoss.
JBoss-4.0.2, Hibernate 3.1.2 and Hibernate-Tools
There seems to be a few problems:
* jboss' version of hibernate
* the version I use to compile
Initially I received an incorrect version error:
Code:
The content of element type "version" must match "(meta)*"
Basically, guessed that the version of Hibernate that I had compiled with wasn't compatible with the one that the JBoss server was running. So, I replaced JBoss' with the Hibernate download.
Now, however, I get the following:
Code:
Caused by: java.lang.ExceptionInInitializerError
at com.catstest.portal.util.HibernateUtil.<clinit>(Unknown Source)
at com.catstest.portal.delegate.HibAnnualExamDel.getAnnualExam(Unknown Source)
at com.catstest.portal.action.AdminExamAction.showExamDetail(Unknown Source)
... 49 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/SecondPass
at org.hibernate.cfg.Configuration.add(Configuration.java:386)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1296)
... 52 more
Which looks to be a packaging issue.
I've packaged all of hibernate's generated classes and mappings into a .har file. I added the .har file as a module to the jboss-app.xml found in my .ear. I added a jboss-app.xml to the .har for the hibernate3.jar file so jboss would stop complaining about multiple instances found.
All in all nothing seems to work. Please advise.
Thanks.
Graham