[jboss-jira] [JBoss JIRA] (WFLY-13391) getContextClassLoader is null in Managed thread factory
Dheeraj Joshi (Jira)
issues at jboss.org
Sat Apr 18 05:40:00 EDT 2020
[ https://issues.redhat.com/browse/WFLY-13391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dheeraj Joshi updated WFLY-13391:
---------------------------------
Description:
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}
classLoader 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.
was:
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.
> 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: 18.0.1.Final, 19.0.0.Final
> Reporter: Dheeraj Joshi
> Assignee: Eduardo Martins
> Priority: Major
> 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}
> classLoader 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)
More information about the jboss-jira
mailing list