2 Replies Latest reply on Nov 26, 2007 6:52 AM by Sean Radford

    Isolated classloader and XML defined Factory Components

    Sean Radford Novice

      Hi,

      Got bit of an issue with 2 Seam applications in the same JVM (in own classloader repositories).

      In both applications there is an Application scoped configuration component (whose classes are within the ears) that are instantiated via a factory defined in their respective components.xml.

      The issue is the configuration Component for App A appearing in App B in the following scenario.

      1. A Faces request starts in App A
      2. App A instantiates Config Component A via its component.xml file
      3. App A makes a remote callByValue EJB call to App B
      4. App B needs Config Component B. It looks in its Application Context, which does not contain an instance and so tries to create it. In doing so it requires an Expressions instance and finds the Application A com.sun.faces.context.FacesContextImpl on the Thread. Using this Expressions instance it then instantiates a Config Component using classes within App A's classloader repository which then results in a ClassCastException when trying to be used in Application B.


      I guess the 'root issue' is the fact that the JSF classes from JBossWeb are shared between the 2 applications (seen in the classloader list for both application repositories in the JMX console ). And I can't see how to configure JBoss to use separate ones for each application.

      Anyone able to help with this?

      Thanks and regards,

      Sean