glassfish
  1. glassfish
  2. GLASSFISH-16547

Error processing EjbDescriptor deploying EJB module

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 3.1_b43
    • Fix Version/s: None
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Windows 7 Pro, JDK 1.6.0_24-b07

      Description

      I am trying to port an existing EE5 application from glassfish 2.1.1 to 3.1(b43) and I have deployment problems.
      The rough structure of the application is as follows:

      • EJB.jar contains the implementation of a set of stateless session beans
      • EJBClient.jar contains their local and remote interfaces
      • many distinct web applications, containing servlets and web services that call EJBs

      The reason why it is structured like that is that I don't want to include the whole EJBs code into web applications, but just their remote interfaces.

      Up to GF 2.1.1 I was able to deploy just EJB.jar, besides all the WARs.
      With GF3.1 I must package EJB.jar and EJBClient.jar into an EAR, otherwise I get the exception quoted below.

      I'm attaching sample projects that reproduce the problem. To get the exception, deploy PippoEJB.jar. If you deploy PippoEAR, on the contrary, everything works fine.

      #|2011-05-04T18:20:11.896+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=54;_ThreadName=Thread-1;|Error processing EjbDescriptor
      java.lang.RuntimeException: Error processing EjbDescriptor
      at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:277)
      at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2578)
      at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:734)
      at com.sun.enterprise.deployment.Application.visit(Application.java:1768)
      at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:244)
      at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170)
      at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:826)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:768)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
      at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
      at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:577)
      at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:463)
      at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:395)
      at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
      at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:213)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)
      Caused by: java.lang.NullPointerException
      at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.convertToResourceName(APIClassLoaderServiceImpl.java:269)
      at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:178)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:222)
      ... 24 more

      #]

      [#|2011-05-04T18:20:11.896+0200|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=54;_ThreadName=Thread-1;|Exception while deploying the app [PippoEJB] : Error processing EjbDescriptor
      java.lang.NullPointerException
      at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.convertToResourceName(APIClassLoaderServiceImpl.java:269)
      at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:178)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:222)
      at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2578)
      at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:734)
      at com.sun.enterprise.deployment.Application.visit(Application.java:1768)
      at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:244)
      at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170)
      at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:826)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:768)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
      at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
      at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:577)
      at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:463)
      at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:395)
      at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
      at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:213)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)

      #]

        Activity

        Hide
        marina vatkina added a comment -

        Assigning to Hong to verify the difference in deployment between v2 and v3

        Show
        marina vatkina added a comment - Assigning to Hong to verify the difference in deployment between v2 and v3
        Hide
        Hong Zhang added a comment -

        I tried to deploy the PippoEJB.jar with v2.*, I got similar errors:

        [#|2011-06-03T16:06:35.612-0400|WARNING|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=18;_ThreadName=Thread-66;_RequestID=3aaa218a-96a0-431b-93ff-4a1fcd4a8909;|Error in annotation processing: java.lang.NoClassDefFoundError: it/idoq/lucystar/ejb/test/PippoBeanLocal|#]

        [#|2011-06-03T16:06:35.640-0400|SEVERE|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=18;_ThreadName=Thread-66;_RequestID=3aaa218a-96a0-431b-93ff-4a1fcd4a8909;|Exception occured in J2EEC Phasejava.lang.RuntimeException: Error processing EjbDescriptor
        com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment descriptors for module [PippoEJB] – Error processing EjbDescriptor
        at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:406)
        at com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:426)
        at com.sun.enterprise.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:141)
        at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:182)
        at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
        at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)
        Caused by: java.lang.RuntimeException: Error processing EjbDescriptor
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:297)
        at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2058)
        at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:735)
        at com.sun.enterprise.deployment.archivist.EjbArchivist.validate(EjbArchivist.java:190)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:840)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:794)
        at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:365)
        ... 10 more
        Caused by: java.lang.NullPointerException
        at java.util.Hashtable.get(Hashtable.java:334)
        at com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:136)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at com.sun.appserv.server.util.ClassLoaderChain.loadClass(ClassLoaderChain.java:158)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at com.sun.appserv.server.util.ClassLoaderChain.loadClass(ClassLoaderChain.java:158)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:254)
        ... 16 more

        I understand you hope to use your application as it is, but it is an EJB spec requirement that the interfaces must be available (either through packaging inside the application or referenced some other way).

        Quote from EJB spec:

        20.3 Packaging Requirements
        The ejb-jar file or .war file must contain, either by inclusion or by reference, the class files of each enterprise bean as follows:
        • The enterprise bean class.
        • The enterprise bean business interfaces, web service endpoint interfaces, and home and component interfaces.
        • Interceptor classes.
        • The primary key class if the bean is an entity bean.

        You could package the interface classes directly in the ejb jar. And you can include the interfaces in the ear lib if you choose to package the application as an ear. And if you want to just deploy this as a standalone ejb jar, you could include references to the interfaces somehow, for example, by using a --libraries option.

        As the EJB spec states, the ejb must contain the interfaces (by inclusion or by reference), this is not a bug in GlassFish. I will go ahead and close the issue.

        Note: I am only talking about regular GlassFish here, if you think there is any issue with embedded GlassFish, please file a separate issue under "embedded" to avoid confusion.

        Show
        Hong Zhang added a comment - I tried to deploy the PippoEJB.jar with v2.*, I got similar errors: [#|2011-06-03T16:06:35.612-0400|WARNING|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=18;_ThreadName=Thread-66;_RequestID=3aaa218a-96a0-431b-93ff-4a1fcd4a8909;|Error in annotation processing: java.lang.NoClassDefFoundError: it/idoq/lucystar/ejb/test/PippoBeanLocal|#] [#|2011-06-03T16:06:35.640-0400|SEVERE|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=18;_ThreadName=Thread-66;_RequestID=3aaa218a-96a0-431b-93ff-4a1fcd4a8909;|Exception occured in J2EEC Phasejava.lang.RuntimeException: Error processing EjbDescriptor com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment descriptors for module [PippoEJB] – Error processing EjbDescriptor at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:406) at com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:426) at com.sun.enterprise.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:141) at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:182) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225) Caused by: java.lang.RuntimeException: Error processing EjbDescriptor at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:297) at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2058) at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:735) at com.sun.enterprise.deployment.archivist.EjbArchivist.validate(EjbArchivist.java:190) at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:840) at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:794) at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:365) ... 10 more Caused by: java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:334) at com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:136) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at com.sun.appserv.server.util.ClassLoaderChain.loadClass(ClassLoaderChain.java:158) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at com.sun.appserv.server.util.ClassLoaderChain.loadClass(ClassLoaderChain.java:158) at java.lang.ClassLoader.loadClass(ClassLoader.java:300) at java.lang.ClassLoader.loadClass(ClassLoader.java:300) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:254) ... 16 more I understand you hope to use your application as it is, but it is an EJB spec requirement that the interfaces must be available (either through packaging inside the application or referenced some other way). Quote from EJB spec: 20.3 Packaging Requirements The ejb-jar file or .war file must contain, either by inclusion or by reference, the class files of each enterprise bean as follows: • The enterprise bean class. • The enterprise bean business interfaces, web service endpoint interfaces, and home and component interfaces. • Interceptor classes. • The primary key class if the bean is an entity bean. You could package the interface classes directly in the ejb jar. And you can include the interfaces in the ear lib if you choose to package the application as an ear. And if you want to just deploy this as a standalone ejb jar, you could include references to the interfaces somehow, for example, by using a --libraries option. As the EJB spec states, the ejb must contain the interfaces (by inclusion or by reference), this is not a bug in GlassFish. I will go ahead and close the issue. Note: I am only talking about regular GlassFish here, if you think there is any issue with embedded GlassFish, please file a separate issue under "embedded" to avoid confusion.
        Hide
        raypettas added a comment -

        These are the correct test cases for this issue.

        Show
        raypettas added a comment - These are the correct test cases for this issue.
        Hide
        raypettas added a comment -

        You're right, because I attached the wrong test case My apologies.

        Nonetheless, the problem remains. I have attached the correct tests.

        If you open both the EAR and the JAR, you will notice that the contents are more or less the same, only differently packaged.

        I believe that in both cases the spec is satisfied and interfaces are available to EJBs (in PippoClientEJB.jar). At least, GF2.1.1 seems to consider it satisfied, since both deploys work in 2.1.1.

        GF3.1, though, only accepts EAR deployment and not JAR.

        Show
        raypettas added a comment - You're right, because I attached the wrong test case My apologies. Nonetheless, the problem remains. I have attached the correct tests. If you open both the EAR and the JAR, you will notice that the contents are more or less the same, only differently packaged. I believe that in both cases the spec is satisfied and interfaces are available to EJBs (in PippoClientEJB.jar). At least, GF2.1.1 seems to consider it satisfied, since both deploys work in 2.1.1. GF3.1, though, only accepts EAR deployment and not JAR.
        Hide
        Hong Zhang added a comment -

        Now I see what you are saying

        Yes, there was some behavior change in this area. In 3.*, we enforced the EE6 jar visiblity rules: for a portable application, the library jars at the standalone ejb jar root level are not guaranteed to be visible to EJB classes.

        We did this to encourge developers to write EE portable applications, however you can use the following property to maintain v2 jar visibility behavior:
        asadmin deploy --property compatibility=v2 PippoEJB_DeployKO.jar

        Show
        Hong Zhang added a comment - Now I see what you are saying Yes, there was some behavior change in this area. In 3.*, we enforced the EE6 jar visiblity rules: for a portable application, the library jars at the standalone ejb jar root level are not guaranteed to be visible to EJB classes. We did this to encourge developers to write EE portable applications, however you can use the following property to maintain v2 jar visibility behavior: asadmin deploy --property compatibility=v2 PippoEJB_DeployKO.jar

          People

          • Assignee:
            Hong Zhang
            Reporter:
            raypettas
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: