Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-13345

Deployments fails if AsyncListener in WEB-INF/classes or in a jar in WEB-INF/lib references a class that isn't on the classpath

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 21.0.0.Beta1, 21.0.0.Final
    • 19.0.0.Final
    • EE
    • None

      This bug is similar to WFLY-8515 but still occurs in 19.0.0.Final

      If a web application contains a jar in WEB-INF/lib that has an AsyncListener that references a class or an interface that isn't on the classpath, deployment of the web application will fail with the following:

      2020-04-07 23:55:28,849 WARN  [org.jboss.modules.define] (MSC service thread 1-8) Failed to define class io.micrometer.core.instrument.binder.jetty.TimedHandler in Module "deployment.spring-boot.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link io/micrometer/core/instrument/binder/jetty/TimedHandler (Module "deployment.spring-boot.war" from Service Module Loader): org/eclipse/jetty/util/component/Graceful
      	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1095)
      	at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
      	at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
      	at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
      	at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
      	at org.jboss.modules.Module.loadModuleClass(Module.java:731)
      	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      	at java.base/java.lang.Class.getDeclaredFields0(Native Method)
      	at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
      	at java.base/java.lang.Class.getDeclaredFields(Class.java:2248)
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
      	at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
      	at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
      	at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      
      2020-04-07 23:55:28,851 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."spring-boot.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."spring-boot.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "spring-boot.war"
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
      	at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
      	at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
      	at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class io.micrometer.core.instrument.binder.jetty.TimedHandler$OnCompletionListener with ClassLoader ModuleClassLoader for Module "deployment.spring-boot.war" from Service Module Loader
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
      	at org.jboss.as.ee@19.0.0.Final//org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
      	... 8 more
      Caused by: java.lang.NoClassDefFoundError: Failed to link io/micrometer/core/instrument/binder/jetty/TimedHandler (Module "deployment.spring-boot.war" from Service Module Loader): org/eclipse/jetty/util/component/Graceful
      	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1095)
      	at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
      	at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
      	at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
      	at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
      	at org.jboss.modules.Module.loadModuleClass(Module.java:731)
      	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      	at java.base/java.lang.Class.getDeclaredFields0(Native Method)
      	at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061)
      	at java.base/java.lang.Class.getDeclaredFields(Class.java:2248)
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
      	at org.jboss.as.server@11.0.0.Final//org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
      	... 13 more
      

      The easiest way to reproduce this issue is to include Micrometer v1.4.1 which includes this code.

      I suspect that moving this line of InterceptorAnnotationProcessor into the try/catch block would fix the issue.

              bstansbe@redhat.com Brian Stansberry
              pwebb-1 Phillip Webb (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: