Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-3758

NoClassDefFoundError: org/jboss/seam/intercept/Proxy when Seam Component is an EJB in another module


    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.2.GA, 2.0.2.SP1, 2.1.0.GA, 2.1.0.SP1
    • Fix Version/s: 2.1.1.CR2
    • Component/s: Core
    • Labels:


      I have all my backing beans in the web application (java bean components). My business logic is inside EJBs in a module which has no reference to Seam whatsoever. So, the EAR class loader has no reference to Seam classes, Seam's jar are only in my web application (WEB-INF/lib).
      After some debugging, I saw that seam (2.0.2.SP1) passes an Array of interfaces to the ProxyFactory class. ProxyFactory gets the ClassLoader from the first class in the array. When the first class in the array is either Proxy or Instance, everything works fine. When the EJB interface is the first element on the array (happens after a few restarts of JBoss), ProxyFactory gets its ClassLoader, the EAR ClassLoader, which, as metioned before, doesn't "know" about Seam.

      I think a simple solution would be change the method createProxyFactory in the Component class to the following:

      Set<Class> interfaces = new TreeSet<Class>(); // instead of a HashSet, to guarantee the order of the elements
      // so these classes the first elements on the array
      if ( type.isSessionBean() )

      { interfaces.addAll(businessInterfaces); }


      { interfaces.add(HttpSessionActivationListener.class); interfaces.add(Mutable.class); }

      ProxyFactory factory = new ProxyFactory();
      // excluding this part, which was included in 2.1.0, but didn't really solved the problem
      protected ClassLoader getClassLoader()

      { return beanClass.getClassLoader(); }


      A full description of the problem can be found at the forum location above.

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  pmuir Pete Muir
                  andrenpaes Andre Rodrigues
                • Votes:
                  0 Vote for this issue
                  3 Start watching this issue


                  • Created: