[jboss-user] [Installation, Configuration & DEPLOYMENT] - ClassCastException During Hibernate Session.get() when using

gigsvoo do-not-reply at jboss.com
Tue May 13 12:25:09 EDT 2008


Hi there,

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


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150451#4150451

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150451



More information about the jboss-user mailing list