Hi all,
I have one .ear file which contains a straight-forward Stateless Session Bean. I have a second .ear file that contains some JSP files. I have a ServiceLocator class(in 2nd .ear file) that is called by the JSP files in the 2nd .ear file which has the following code:
However, the call to the PortableRemoteObject.narrow method throws a
java.lang.ClassCastException. I've been reading many posts that explain the way the JBOSS classloaders work and how that it basically creates a "flat" classloader repository. I've also read that a class definition is only loaded once and the first classloader to load it wins. So, in my case I think the first .ear file, the one with the EJB and binding the object to JNDI has one classloader. The ServiceLocator is using a different classloader, which is causing this exception to occur.
So, my question is how can I get the ServiceLocator to use the same classloader that was used by the 1st .ear with the EJB?
thanks in advance