[
https://issues.jboss.org/browse/WFLY-11808?page=com.atlassian.jira.plugin...
]
Cheng Fang edited comment on WFLY-11808 at 3/20/19 7:45 PM:
------------------------------------------------------------
The batch subsystem chose the name context for the batch job execution as follows:
{code:java}
org.jboss.as.naming.context.NamespaceContextSelector.getCurrentSelector();
{code}
So for a job execution request from the management console or CLI, the current thread is
"External Management Threads - 1", and its associated name context is used for
batch job execution, but this name context has no knowlege of the deployment that contains
the batch job. Any lookup of application resources done from any batch artifacts during
the batch job execution will simply fail.
See attached screenshot of external management request thread vs default task thread.
was (Author: cfang):
The batch subsystem chose the name context for the batch job execution as follows:
{code:java}
org.jboss.as.naming.context.NamespaceContextSelector.getCurrentSelector();
{code}
So for a job execution request from the management console or CLI, the current thread is
"External Management Threads - 1", and its associated name context is used for
batch job execution, but this name context has no knowlege of the deployment that contains
the batch job. Any lookup of application resources done from any batch artifacts during
the batch job execution will simply fail.
Unable to do jndi lookup when starting batch job from web console
-----------------------------------------------------------------
Key: WFLY-11808
URL:
https://issues.jboss.org/browse/WFLY-11808
Project: WildFly
Issue Type: Bug
Components: Batch
Affects Versions: 16.0.0.Final
Reporter: Cheng Fang
Assignee: Cheng Fang
Priority: Major
Attachments: Default Task Thread.png, External Management Request Thread.png,
Screen Shot 2019-03-04 at 10.38.47 PM.png
when starting a batch job from web console, jndi lookup inside the application's
batch artifacts failed with NameNotFoundException. When the same job is started by the
application, the lookups all go well. Need to check if the naming context is properly
propagated when starting job from the web console.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)