You can use this part for configuring JBoss to use an own loader repository for e.g. every ear (when used in jboss-app.xml):
The name of the repository must be unique and the config tag says JBoss to change the behaviour of classloaders by first asking the child for resources, then delegating to the parent.
Thanks for the suggestion. I tried it with 3.2.1 (jetty) and got the following.
2003-05-23 11:30:38,895 ERROR [org.jboss.deployment.MainDeployer] could not start deployment: file:/D:/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/Tcdc.ear/22.Tcdc.ear-contents/Tcdc.war
java.lang.Error: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
Are you using a "tuned" version of JBoss, since this works for me with 3.2.0 (and I think I tried this with 3.2 HEAD, too)?
My ear contains xerces.jar and castor.jar .
Frito, thanks for the response. I don't think we are using a "tuned" version - I'm just dropping the EAR into the default server deploy dir, I don't think I've done anything else special to my installation.
Obviously including the jboss-app.xml files as you described is having an effect, because with it included the EAR won't even deploy (whereas before I didn't get errors until a client caused code that references one of these jars to be run).
I don't know much about how JBoss does XML processing (and I'm not a xerces expert either). But I don't see a Xerces jar in its lib dir, so could the problem be that JB has its own implementation of SaxParser that is not compatible with Xerces, thus giving the ClassCastException?
Strange. You should be seeing a xercesImpl.jar in the topmost lib directory of the distribution.
Maybe I'm missing something here, but can JBoss use the newer xalan and castor distributions? That is, have the APIs changed so that you can't replace JBoss's copies with the new ones?
On 3.2.0, tried with xalan 2.5.0 distribution - doesn't like the xercesImpl or xml-apis being replaced (in top most lib). Also deleted the xml-apis floating around in my instance libs. Replaced xalan in server/default/lib with xalan 2.5.0 (2.5 Mb file !!!).
Seems to work ok. Deployed range of beans, wars and ears and they worked ok. Does that help any?
Jonlee: You're right, Xerces.impl is in JB's top-level lib dir, I had only been looking in server\default\lib. From what you're finding, it's takes a manual process to configure JBoss 3.2 to allow the use of newer xalan, castor and xerces jars by our apps. Bummer!