Hi there,
I also hit by the same problem.
I deployed a SAR into JBoss 4.2.2 using shipped hibernate version. The JNDI of the SessionFactory loaded and in my WAR (deployed same with SAR at JBOSS_HOME/server/default/deploy) is able to get SessionFactory and Session object.
When I try to do a
Code:
ClassA a = session.get(ClassA.class, id);
I would hit ClassCastException error. During debug session, I had saw the right side return the ClassA object but when it trying to assigned to left side, the error comes out.
The same class of ClassA existed both inside the SAR deployed as well as the WAR deployed.
What could be the reason?
Note: If I turn on the
Code:
Java2ClassLoadingCompliance
UseJbossWebLoader
switches in JBOSS_HOME\server\default\deploy\jboss-web.deployer\META-INF\jboss-service.xml then everything works fine. But I can't do that because they are other components requires library from tomcat container.
Please help. Thanks
Note: Cross reference post
http://forum.hibernate.org/viewtopic.ph ... 12#2385112