I have been searching around and not been able to find much that is particularly in depth about how to configure the classloading for jboss.
I have read through this:
and tried configuring my jboss-app.xml accordingly, by pointing the class that is giving me NoSuchMethodError explicitly at the jar I want it loaded from ( e.g. javax.xml.soap.SOAPElement:loader=myearapp.ear and javax.xml.soap.SOAPElement:archive=saaj-api-1.3.jar ).
This doesn't appear to work in the jboss-app.xml at EAR level but only in the jboss-web.xml at WAR level ( e.g. javax.xml.soap.SOAPElement:loader=mywarapp.war ) with the libraries in the WEB-INF/lib, and I have a feeling that is because that is the first place searched for classes.
I have also read this:
and tried using that suggestion in the jboss-app.xml, it did appear to have some affect but not the desired one of looking at the EAR for classes prior to the app server.
I have also read the jboss-app DTD from here:
http://www.jboss.org/j2ee/dtd/ ( then the jboss-app_4_0.dtd for my version )
which gives me info about the elements allowed with in the jboss-app.xml but gives no extra information on the values that are valid within those elements.
If anyone could provide me with more information about jboss classloading or specifically about the values that are appropriate for the jboss-app.xml loader-repository tag it would be very helpful indeed. this is a bit of a classloading nightmare.
and not from the EAR's APP-INF/lib.
The APP-INF folder is not identified by JBoss. I guess it's specific to WebSphere.
Any specific reason why you are using a old version of JBoss? In this version of JBoss, i guess you can create a "lib" folder at the root of the EAR and then add all the necessary jars to this lib folder. You will additionally have to mark all these jars as a java module in the application.xml:
<module> <java>lib/saaj.jar</java> </module>
You might sometimes need to scope the classloaders (through jboss-app.xml) if you are packaging any jars which are already provided by JBoss.
In JBoss-4.2.x, this is much easier. You can just drop all the necessary jars in the EAR/lib folder without having to add them as java modules in application.xml. And the classloader scoping needs to be done here too, if you are overriding some jar files.
I can't do anything about the version of jboss I am using I am afraid, believe me I would if I could.
On top of that I am using a build system that packages the EARs up in a specific way, including putting all the jars files in the APP-INF/lib directory. It would be possible for me to configure the build to do it differently, but instead of that I used your suggestion and registered all the jars using:
<module> <java>APP-INF/lib/saaj.jar</java> </module>
Now if I have a jboss-app.xml containing this:
<jboss-app> <loader-repository> hello:service=LoaderRepository </loader-repository> </jboss-app>
All my jars are loaded from the EAR successfully.
Thanks again for your help jaikiran, greatly appreciated.