Dheeraj Joshi created WFLY-13391:
------------------------------------
Summary: getContextClassLoader is null in Managed thread factory
Key: WFLY-13391
URL:
https://issues.redhat.com/browse/WFLY-13391
Project: WildFly
Issue Type: Bug
Components: Concurrency Utilities
Affects Versions: 19.0.0.Final, 18.0.1.Final
Reporter: Dheeraj Joshi
Assignee: Eduardo Martins
Attachments: WildFly-16-server.log, WildFly-17-server.log, WildFly-18-server.log
We are using managed-thread-factory and Threads belong to this do not have context class
loader associated with it
{code:java}
<managed-thread-factories>
<managed-thread-factory name="FlowWorkManagerThreadFactory"
jndi-name="java:jboss/ee/concurrency/factory/FlowWorkManagerThreadFactory"
context-service="default"/>
</managed-thread-factories>
<managed-executor-services>
<managed-executor-service
name="InteractiveWorkflowWorkManagerExecutorService"
jndi-name="java:jboss/ee/concurrency/executor/FLOW_MANAGEDEXECUTOR"
core-threads="${threadpool.interactiveWorkflow.minthread}"
max-threads="${threadpool.interactiveWorkflow.maxthread}"
keepalive-time="5000"
queue-length="${threadpool.interactiveWorkflow.queuesize}"
thread-factory="FlowWorkManagerThreadFactory"
hung-task-threshold="600000" />
</managed-executor-services>
{code}
classLoade variable in below code
{code:java}
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
{code}
evaluates as null when called inside managed thread.
Same code works fine with {{Wildfly 16}} and {{Wildfly 17.0.1}}
In 16 and 17.0.1 The class loader is from Service module loader.
Server logs with {{org.jboss.as.ee}} in {{TRACE}} level for {{Wildfly 16, 17.0.1 and 18}}
are attached.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)