-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Hibernate in Jboss4.2.2
PostPosted: Mon Mar 03, 2008 4:18 pm 
Newbie

Joined: Wed Feb 20, 2008 6:42 pm
Posts: 14
Hi all,
Is it only me, or every body else know how to get around this ?
Heres my situation: I dont want to use hibernate jars which comes in Jboss4.2.2 distribution. These jars are old (3.2.1). I want to use the latest version with Jboss4.2.2.
I tried keeping my ear file isolated using the tag in ear-deployer.xml. But I am getting the classic ClassCastException. Somehow Jboss always wants to use its version of hibernate jar files.

Any help is highly appreciated !!

thanks
Anil.


Top
 Profile  
 
 Post subject: Re: Hibernate in Jboss4.2.2
PostPosted: Mon Mar 03, 2008 4:27 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
You will need to look into changing class loader policy from parent first to parent last. I don't specifically remember how you specify this in JBoss but google it and you should be happy. Also you may have to add hibernate.jar as a java module in application.xml file.



Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 5:04 pm 
Newbie

Joined: Wed Feb 20, 2008 6:42 pm
Posts: 14
thanks a lot Farzad !

But unfortunately, I couldnt find out the right place to modify the parent first class loading policy. The only tag I could find is the one in jboss-web.deployer, which I changed and still end up in the same error. I added the hibernate3.jar in the application.xml.

May be I interpreted it wrongly: this is the chunk of exception I am getting:
Code:
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
   at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:245)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)


thanks
Anil.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 5:09 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
Umm, I have never tried this one but since the exception is in a JBoss class it gives me the feeling a hibernate class might be already loaded before your application is loaded and that means you can't do much but to replace the hibernate jar in jboss lib directory.


Farzad-


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.