glassfish
  1. glassfish
  2. GLASSFISH-17396

java.lang.ClassNotFoundException: Cannot deploy EAR with beans.xml and session bean contained in WAR

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.2_b14
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Windows 7 x64, deployment through Netbeans

      Description

      When I try to deploy a maven EAR application with CDI enabled in both EJB and WAR application I have a java.lang.ClassNotFoundException:

      Caused by: java.lang.ClassNotFoundException: com.alniks.test.cdi.web.LoggingInterceptor
      at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:787)
      at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      at org.jboss.weld.resources.DefaultResourceLoader.classForName(DefaultResourceLoader.java:52)
      at org.jboss.weld.manager.Enabled$ClassLoader.apply(Enabled.java:71)
      ... 41 more

        Activity

        Hide
        Sivakumar Thyagarajan added a comment -

        Requesting Kshitiz to investigate

        Show
        Sivakumar Thyagarajan added a comment - Requesting Kshitiz to investigate
        Hide
        kshitiz_saxena added a comment -

        If multiple modules within ear have beans.xml file, class loading may fail as classloader set in thread context may point to a different BDA(Bean Deployment Archive). To fix this issue, a resource loader is created per BDA pointing to BDA's classloader. This will override default resource loader which used to depend on thread context classloader.

        3.1.2 checkin logs :
        Sending src/main/java/org/glassfish/weld/BeanDeploymentArchiveImpl.java
        Adding src/main/java/org/glassfish/weld/ResourceLoaderImpl.java
        Sending src/main/java/org/glassfish/weld/WeldDeployer.java
        Transmitting file data ...
        Committed revision 51422.

        trunk checkin logs :
        Sending weld-integration/src/main/java/org/glassfish/weld/BeanDeploymentArchiveImpl.java
        Adding weld-integration/src/main/java/org/glassfish/weld/ResourceLoaderImpl.java
        Sending weld-integration/src/main/java/org/glassfish/weld/WeldDeployer.java
        Transmitting file data ...
        Committed revision 51425.

        Show
        kshitiz_saxena added a comment - If multiple modules within ear have beans.xml file, class loading may fail as classloader set in thread context may point to a different BDA(Bean Deployment Archive). To fix this issue, a resource loader is created per BDA pointing to BDA's classloader. This will override default resource loader which used to depend on thread context classloader. 3.1.2 checkin logs : Sending src/main/java/org/glassfish/weld/BeanDeploymentArchiveImpl.java Adding src/main/java/org/glassfish/weld/ResourceLoaderImpl.java Sending src/main/java/org/glassfish/weld/WeldDeployer.java Transmitting file data ... Committed revision 51422. trunk checkin logs : Sending weld-integration/src/main/java/org/glassfish/weld/BeanDeploymentArchiveImpl.java Adding weld-integration/src/main/java/org/glassfish/weld/ResourceLoaderImpl.java Sending weld-integration/src/main/java/org/glassfish/weld/WeldDeployer.java Transmitting file data ... Committed revision 51425.

          People

          • Assignee:
            kshitiz_saxena
            Reporter:
            alniks
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: