glassfish
  1. glassfish
  2. GLASSFISH-985

misleading error message and server log content for JDK mismatch

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0peur1
    • Fix Version/s: 9.1pe_dev
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      985
    • Status Whiteboard:
      Hide

      fixed-9.0peur1

      Show
      fixed-9.0peur1

      Description

      I created an ejb jar (that has a stateless EJB in it). I compiled the classes
      with JDK 6.

      I deployed the jar to GF V1 U1 B5... (which was running under/against J2SE 5
      Update 6).

      Here is what I saw:

      vbk@ubuntuabihsot:~/glassfish$ bin/asadmin deploy ~/EJBModule2/dist/EJBModule2.jar
      CLI171 Command deploy failed : Deploying application in domain failed; Error
      loading deployment descriptors for module [EJBModule2] – Invalid ejb jar
      [/home/vbk/glassfish/domains/domain1/applications/j2ee-modules/EJBModule2]: it
      contains zero ejb.
      Note:
      1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
      message driven bean.
      2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
      -------------- end quote ----------------------

      The server log contained these messages/stack traces:

      ADM1006:Uploading the file to:[/tmp/s1astempdomain1server-1539301823/EJBModule2.jar]
      Cannot load foo.NewSessionBean reason : Bad version number in .class file
      Exception occured in J2EEC Phase
      com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading
      deployment descriptors for module [EJBModule2] – Invalid ejb jar
      [/home/vbk/glassfish/domains/domain1/applications/j2ee-modules/EJBModule2]: it
      contains zero ejb.
      Note:
      1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
      message driven bean.
      2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
      at
      com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:362)
      at
      com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:395)
      at
      com.sun.enterprise.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:138)
      at
      com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:160)
      at
      com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
      at
      com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
      at
      com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
      at
      com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
      Caused by: java.lang.IllegalArgumentException: Invalid ejb jar
      [/home/vbk/glassfish/domains/domain1/applications/j2ee-modules/EJBModule2]: it
      contains zero ejb.
      Note:
      1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
      message driven bean.
      2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
      at
      com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:82)
      at
      com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:675)
      at
      com.sun.enterprise.deployment.archivist.EjbArchivist.validate(EjbArchivist.java:177)
      at
      com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:777)
      at
      com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:731)
      at
      com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:327)
      ... 10 more

      ----------- end quote -------------------

      The root cause of the issue is given one line to try to direct the user to the
      correct fix. I missed it the first time, and I knew what I was looking for!

        Issue Links

          Activity

          Hide
          vince kraemer added a comment -

          flag for message improvement

          Show
          vince kraemer added a comment - flag for message improvement
          Hide
          Hong Zhang added a comment -

          Could you please attach your application? Thanks.

          Show
          Hong Zhang added a comment - Could you please attach your application? Thanks.
          Hide
          vince kraemer added a comment -

          Created an attachment (id=388)
          jar with beans that was compiled with JDK 6

          Show
          vince kraemer added a comment - Created an attachment (id=388) jar with beans that was compiled with JDK 6
          Hide
          Hong Zhang added a comment -

          I have checked in the fix to 9.0ur1.
          With the fix, we now get this error message:
          [hzhang@nmr vince]$ asadmin deploy EJBModule2.jar
          CLI171 Command deploy failed : Deploying application in domain failed; Error
          loading deployment descriptors for module [EJBModule2] – Class
          foo.NewSessionBean has unsupported major or minor version numbers, which are
          greater than those found in the Java Runtime Environment version 1.5.0_05

          Show
          Hong Zhang added a comment - I have checked in the fix to 9.0ur1. With the fix, we now get this error message: [hzhang@nmr vince] $ asadmin deploy EJBModule2.jar CLI171 Command deploy failed : Deploying application in domain failed; Error loading deployment descriptors for module [EJBModule2] – Class foo.NewSessionBean has unsupported major or minor version numbers, which are greater than those found in the Java Runtime Environment version 1.5.0_05
          Hide
          Hong Zhang added a comment -

          Also fixed in 9.1.

          Show
          Hong Zhang added a comment - Also fixed in 9.1.

            People

            • Assignee:
              Hong Zhang
              Reporter:
              vince kraemer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: