[wildfly-dev] How to Select a Different Name Context in Management Request Thread

Brian Stansberry brian.stansberry at redhat.com
Tue Mar 26 14:01:52 EDT 2019


On Wed, Mar 20, 2019 at 6:58 PM Cheng Fang <cfang at redhat.com> wrote:

> Hi,
>
> I'm working on WFLY-11808 <https://issues.jboss.org/browse/WFLY-11808> (Unable
> to do jndi lookup when starting batch job from web console), and would like
> to get some help from team, especially naming and management experts.
>
> The failure occurred when a batch job is started from management console
> or CLI, and during the batch job execution it does some jndi lookup.  The
> lookup failed with NameNotFoundException.
>
> In batch subsystem, it assigns the name context for the job execution by
> calling:
>
> NamespaceContextSelector.getCurrentSelector();
>
> For a management-started job execution, it selected the one associated
> with the current thread which is an external management request thread, and
> apparently has no knowledge of the deployment.
>
> Is there a way to select the name context associated with the deployment
> that contains the batch job?
>

Unfortunately, there isn't a NamespaceContextSelector for a deployment
overall. There's the default selector (which I assume is what
NamespaceContextSelector.getCurrentSelector()
is returning now for this case) and then there are per-EE-component
selectors (see NamespaceConfigurator.configure).

I don't know if what Eduardo Martins is doing on
https://issues.jboss.org/browse/WFLY-9529 may help somewhat, i.e. by making
some commonly requested bindings visible when the thread is handling a from
an EE component.


>
Thanks,
> Cheng
>
>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev



-- 
Brian Stansberry
Manager, Senior Principal Software Engineer
Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/wildfly-dev/attachments/20190326/8c0f2df3/attachment.html 


More information about the wildfly-dev mailing list