I have been looking at a problem which has me completely stumped. I know there is a lot of information out there regarding ClassLoading and I have read most of it. Anyway here is my problem :
I am using jboss 4.2.1, I had an EAR containing an EJB file and a WAR file.
When I deployed this it all worked fine, but, as the EAR was getting a bit big I decided to deploy the EJB and WAR files separately. I applied the relevant changes to allow the WAR to access the EJB remotely as this is now a separate application, this worked for any JSP that didn't have a reference to a shared JAR.
I then removed the JAR from the WAR as it seemed that having two versions (though identical) created a problem. I assumed that this was to do with there being two ClassLoaders. Again this seemed to solve some of the problems which brings me to the crux of the problem.
I have a JAR that is shared between the EJB and the WAR, when I access the via the EJB there is no problem as the JAR is packaged with the EJB.
When I access via the WAR I get strange behaviour, some of the classes are accesed ok (possibly the ones that the EJB has already accessed) but others are not accessable and give a Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: error then the page is accessed (when other pages have already accessed the package sucessfully ?????).
I am sort of convinced that the problem is something to do with the two classloaders but I can't seem to resolve the problem.
Any help would be really appriciated as I am losing the will to live. Surely it isn't this difficult or maybe I am an idiot.