3 Replies Latest reply on Apr 11, 2017 9:09 AM by Rick Gu

    JBoss EAP 7

    Rick Gu Newbie

      trying to migrate from WAS 8.5 to JBoss EAP 7 and encountered below error.

      14:15:18,640 WARN  [org.jboss.modules] (MSC service thread 1-6) Failed to define class javax.jms.JMSException in Module "deployment.xxx.ear.yyy.war:mai
      n
      " from Service Module Loader: java.lang.ClassFormatError: Failed to link javax/jms/JMSException (Module "xxx.ear.yyy.war:main" from Service
      Module Loader): Absent Code attribute in method that is not native or abstract in class file javax/jms/JMSException
        at sun
      .reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun
      .reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun
      .reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java
      .lang.reflect.Constructor.newInstance(Unknown Source)
        at org
      .jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
        at org
      .jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
        at org
      .jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
        at org
      .jboss.modules.Module.loadModuleClass(Module.java:605)
        at org
      .jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
        at org
      .jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
        at org
      .jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
        at org
      .jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
        at java
      .lang.Class.getDeclaredConstructors0(Native Method)
        at java
      .lang.Class.privateGetDeclaredConstructors(Unknown Source)
        at java
      .lang.Class.getConstructor0(Unknown Source)
        at java
      .lang.Class.getConstructor(Unknown Source)
        at org
      .jboss.as.jsf.deployment.JSFManagedBeanProcessor.deploy(JSFManagedBeanProcessor.java:100)
        at org
      .jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java
      .lang.Thread.run(Unknown Source)

      14:15:18,640 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.subunit."xxx.ear"."yyy.war
      ".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."xxx.ear"."yyy.war".POST_MODULE: WFLYSRV0153: Failed to process
      phase POST_MODULE of subdeployment
      "yyy.war" of deployment "xxx.ear"
        at org
      .jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java
      .lang.Thread.run(Unknown Source)
      Caused by: java.lang.ClassFormatError: Failed to link javax/jms/JMSException (Module "deployment.xxx.ear.yyy.war:main" from Service Module Loader): Abs
      ent
      Code attribute in method that is not native or abstract in class file javax/jms/JMSException
        at sun
      .reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun
      .reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun
      .reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java
      .lang.reflect.Constructor.newInstance(Unknown Source)
        at org
      .jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
        at org
      .jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
        at org
      .jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
        at org
      .jboss.modules.Module.loadModuleClass(Module.java:605)
        at org
      .jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
        at org
      .jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
        at org
      .jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
        at org
      .jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
        at java
      .lang.Class.getDeclaredConstructors0(Native Method)
        at java
      .lang.Class.privateGetDeclaredConstructors(Unknown Source)
        at java
      .lang.Class.getConstructor0(Unknown Source)
        at java
      .lang.Class.getConstructor(Unknown Source)
        at org
      .jboss.as.jsf.deployment.JSFManagedBeanProcessor.deploy(JSFManagedBeanProcessor.java:100)
        at org
      .jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
        
      ... 5 more

      From the research, it seems the issue of the dependency, which has interface only.

      <dependency> 
          
      <groupId>javax</groupId>
          
      <artifactId>javaee-api</artifactId>
          
      <version>6.0</version>
          
      <scope>provided</scope>
      </dependency>

      So I changed to

        <dependency> 
          
      <groupId>org.apache.openejb</groupId>
          
      <artifactId>javaee-api</artifactId>
          
      <version>6.0-5</version>
       
      </dependency>

      But no luck. I am also looking for a jar like j2ee.jar. I could find one jboss-ejb-api_3.2_spec-1.0.0.Final-redhat-1.jar under JBoss runtime. But it doesn't contain anything on javax.jms.*.

      Also I looked at class loading. Patched ear file with jboss-deployment-structure.xml with content to eliminating double class loading.

      <jboss-deployment-structure> 
          
      <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
      </jboss-deployment-structure>

      Still doesn't work. Any suggestions?

        • 1. Re: JBoss EAP 7
          Tomaz Cerar Master

          what does your application structure look like?

           

          what kind of jars do you have in your lib folder(s)

          • 2. Re: JBoss EAP 7
            Anup Dey Apprentice

            That javax.javaee-api.6.0 maven dependency has a single well documented problem - the byte code for any implementation classes that it needs has been stripped, resulting in the java.lang.ClassFormatError.

             

            The reason you are seeing this is because even though your dependency says <scope>provided</scope>, a copy of this jar has leaked into your application deployment somewhere. You need to get rid of it.

             

            Once you have done this you can upgrade the dependency to <version>7.0</version> which does not have this problem (which is normally only an issue for unit tests that depend upon it).

            • 3. Re: JBoss EAP 7
              Rick Gu Newbie

              javax.javaee-api.6.0 was the problem. But

                <dependency>
                  
              <groupId>org.apache.openejb</groupId>
                  
              <artifactId>javaee-api</artifactId>
                  
              <version>6.0-5</version>
               
              </dependency>

              should have helped. There was a parent dependency pom still used the javax.javaee-api.6.0. After cleaning all javax.javaee-api.6.0 jars, it worked.