[jboss-user] [EJB 3.0] - Re: Loading different versions of same jar in ear applicatio

rrkulkarni do-not-reply at jboss.com
Sun Oct 5 12:29:40 EDT 2008

Thanks for getting back to me on this issue.

I meant literally putting the jar file inside TestEJB.jar. The idea was that EJB container will load the jar inside TestEJB.jar before looking in lib folder inside EAR.

Trying to use two versions of same jar is exactly what I am trying to do. My EAR has lot of EJB modules some of which make use of earlier ( ancient) version of Castor which is in EAR/LIB folder. I am writing a new EJB that uses latter version of castor. I have written the code assuming later version of Castor. Now while testing I found out that earlier version of castor is stepping on my castor.jar which is inside my TestEJB.jar. 

If I replace the castor.jar in EAR/lib folder my ejb will work but many others which are using old version are failing. My code does not work with old version of castor. 

I was hoping to find some way of using two versions of jar in same EAR. I guess my only option is to rewrite my code using earlier version. I also thought of writing a custom classloader but am not sure if that will even work given that earlier version is already loaded by jboss.

Thanks again

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

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

More information about the jboss-user mailing list