-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
26.1.0.Final
-
None
-
-
---
-
---
Thread context class loader in some cases (can't understand in which) doesn't match the class loader from which application classes are loaded. I have created a relatively small (several libraries, but very few custom code) test deployment to reproduce this.
Additionally, different class loaders exhibit different behavior when loading classes recursively. I'm not sure which is correct. See below for what I mean.
Added by jperkins-rhn:
Full Stack Trace
12:32:17,742 INFO [stdout] (MSC service thread 1-6) @@@ configuring logback 12:32:17,743 INFO [stdout] (MSC service thread 1-6) my class loader: ModuleClassLoader for Module "deployment.class-loaders.war" from Service Module Loader 12:32:17,743 INFO [stdout] (MSC service thread 1-6) thread class loader: ModuleClassLoader for Module "org.jboss.as.server" version 18.1.1.Final from local module loader @43b9fd5 (finder: local module finder @79dc5318 (roots: /home/jperkins/tmp/WFLY-16920/wildfly-26.1.1.Final/modules,/home/jperkins/tmp/WFLY-16920/wildfly-26.1.1.Final/modules/system/layers/base)) 12:32:17,743 INFO [stdout] (MSC service thread 1-6) !!! 12:32:17,744 INFO [stdout] (MSC service thread 1-6) java.lang.ClassNotFoundException: foo.TestDeployment$A from [Module "org.jboss.as.server" version 18.1.1.Final from local module loader @43b9fd5 (finder: local module finder @79dc5318 (roots: /home/jperkins/tmp/WFLY-16920/wildfly-26.1.1.Final/modules,/home/jperkins/tmp/WFLY-16920/wildfly-26.1.1.Final/modules/system/layers/base))] 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200) 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410) 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116) 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at java.base/java.lang.Class.forName0(Native Method) 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at java.base/java.lang.Class.forName(Class.java:398) 12:32:17,744 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//foo.TestDeployment$B.<clinit>(TestDeployment.java:28) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//foo.TestDeployment$A.<clinit>(TestDeployment.java:17) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//foo.TestDeployment.<init>(TestDeployment.java:12) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//foo.LogbackConfigurator.configure(LogbackConfigurator.java:18) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:140) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.slf4j.LoggerFactory.bind(LoggerFactory.java:150) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.camunda.commons.logging.BaseLogger.createLogger(BaseLogger.java:91) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.camunda.bpm.engine.impl.ProcessEngineLogger.<clinit>(ProcessEngineLogger.java:49) 12:32:17,745 INFO [stdout] (MSC service thread 1-6) at deployment.class-loaders.war//org.camunda.bpm.application.impl.ServletProcessApplicationDeployer.<clinit>(ServletProcessApplicationDeployer.java:42) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at java.base/java.lang.Class.newInstance(Class.java:584) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at org.wildfly.extension.undertow@26.1.1.Final//org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:225) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at org.wildfly.extension.undertow@26.1.1.Final//org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:135) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at org.jboss.as.server@18.1.1.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at org.jboss.msc@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at org.jboss.msc@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701) 12:32:17,746 INFO [stdout] (MSC service thread 1-6) at org.jboss.msc@1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559) 12:32:17,747 INFO [stdout] (MSC service thread 1-6) at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) 12:32:17,747 INFO [stdout] (MSC service thread 1-6) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) 12:32:17,747 INFO [stdout] (MSC service thread 1-6) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) 12:32:17,747 INFO [stdout] (MSC service thread 1-6) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363) 12:32:17,747 INFO [stdout] (MSC service thread 1-6) at java.base/java.lang.Thread.run(Thread.java:829) 12:32:17,767 INFO [stdout] (ServerService Thread Pool -- 82) @@@ startup 12:32:17,768 INFO [stdout] (ServerService Thread Pool -- 82) my class loader: ModuleClassLoader for Module "deployment.class-loaders.war" from Service Module Loader 12:32:17,768 INFO [stdout] (ServerService Thread Pool -- 82) thread class loader: ModuleClassLoader for Module "deployment.class-loaders.war" from Service Module Loader