1 Reply Latest reply on Jul 29, 2011 10:49 AM by Louis Burton

    Prefer EAR lib for only a single package

    Louis Burton Newbie



      As I understand it, you can isolate the EAR classloader such that it's packaged libs are used in preference to JBoss'. We have not needed this previously.


      I understand you can configure this via ear-deployer.xml using:

      <attribute name="Isolated">true</attribute>


      I also believe you can do this via the EAR/META-INF/jboss-app.xml using:








      I've also read that for jboss 5 and above you can use a jboss-classloading.xml file, although I'm not fully familiar with this.


      I need a solution for JBoss 5.1 CE, and JBoss 4.3 EAP.


      Basically, as soon as I switch on either of the first two methods suggested, I run into ClassCastExceptions (I believe because we package a version of xerces - java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader).


      What I desire is that only the org.quartz package is used from our EAR. I can circumvent this problem by removing the quartz-ra and quartz.jar from JBoss and leaving the classloaders, but this is not desirable. I thought the whole point of giving a package value in the loader-repository would only affect the classloading of this specific package?


      There is a wealth of info out there, but I've not found anything that tackles my specific use case yet. Sorry if I've missed something obvious!

      Currently reading: http://community.jboss.org/wiki/JBossClassLoadingUseCases


      Any help is much appreciated.