Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-17807

[GSS](7.2.z) WFLY-12596 Hibernate bytecode transformer needs to pass classloader into ASM ClassWriter for super classes that are in a different classloader

XMLWordPrintable

      Some users have reported seeing warnings like:

      WARN [org.jboss.modules.define] (MSC service thread 1-4) Failed to define class BGP in Module "deployment.mine.ear" from Service Module Loader: java.lang.ClassFormatError: Failed to link SuperClassInDifferentEarClassLoader (Module "deployment.mine.ear" from Service Module Loader): Type EntityBean not present

      Where class SuperClassInDifferentEarClassLoader, is a super class that is contained in a different EAR classloader than the subclass.

      The workaround should be passing the classloader to use in to the ASM ClassWriter class, by extending the ClassWriter class and providing an implementation of getClassLoader() method.

      12:56:09,573 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:937)
      12:56:09,574 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.SymbolTable.addMergedType(SymbolTable.java:1200)
      12:56:09,574 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.Frame.merge(Frame.java:1299)
      12:56:09,574 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.Frame.merge(Frame.java:1197)
      12:56:09,574 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.MethodWriter.computeAllFrames(MethodWriter.java:1607)
      12:56:09,574 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1543)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:762)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2431)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1283)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.ClassReader.accept(ClassReader.java:688)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.ClassReader.accept(ClassReader.java:400)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.hibernate.Hibernate51CompatibilityTransformer.transform(Hibernate51CompatibilityTransformer.java:102)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.server.deployment.module.DelegatingClassFileTransformer.transform(DelegatingClassFileTransformer.java:60)
      12:56:09,575 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.JLIClassTransformer.transform(JLIClassTransformer.java:55)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:539)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.Module.loadModuleClass(Module.java:731)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      12:56:09,576 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass1(Native Method)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass(ClassLoader.java:839)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
      12:56:09,577 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.Module.loadModuleClass(Module.java:731)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass1(Native Method)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      12:56:09,578 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass(ClassLoader.java:839)
      12:56:09,579 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
      12:56:09,579 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
      12:56:09,579 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
      12:56:09,579 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
      12:56:09,579 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.Module.loadModuleClass(Module.java:731)
      12:56:09,579 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass1(Native Method)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at java.lang.ClassLoader.defineClass(ClassLoader.java:839)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
      12:56:09,580 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.Module.loadModuleClass(Module.java:731)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      12:56:09,581 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Class.forName0(Native Method)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Class.forName(Class.java:348)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.ee.utils.ClassLoadingUtils.loadClass(ClassLoadingUtils.java:21)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.ee.utils.ClassLoadingUtils.loadClass(ClassLoadingUtils.java:14)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:84)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
      12:56:09,582 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
      12:56:09,583 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
      12:56:09,583 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
      12:56:09,583 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
      12:56:09,583 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      12:56:09,583 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      12:56:09,583 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      12:56:09,584 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      12:56:09,584 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Thread.run(Thread.java:748)
      12:56:09,584 ERROR [stderr] (MSC service thread 1-4) Caused by: java.lang.ClassNotFoundException: SuperClassInDifferentEarClassLoader from [Module "asm.asm" version 7.1 from local module loader @636be97c (finder: local module finder @50a638b5 (roots: /home/smarlow/work/wildfly/dist/target/wildfly-18.0.0.Final-SNAPSHOT/modules,/home/smarlow/work/wildfly/dist/target/wildfly-18.0.0.Final-SNAPSHOT/modules/system/layers/base))]
      12:56:09,584 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
      12:56:09,584 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      12:56:09,584 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      12:56:09,585 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      12:56:09,585 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Class.forName0(Native Method)
      12:56:09,585 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Class.forName(Class.java:348)
      12:56:09,585 ERROR [stderr] (MSC service thread 1-4)    at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:935)
      12:56:09,585 ERROR [stderr] (MSC service thread 1-4)    ... 72 more
      

            rhn-support-ivassile Ilia Vassilev
            rhn-support-toross Tom Ross
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: