How to Select a Different Name Context in Management Request Thread

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to Select a Different Name Context in Management Request Thread

Cheng Fang
Hi,

I'm working on 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?

Thanks,
Cheng



_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to Select a Different Name Context in Management Request Thread

Brian Stansberry


On Wed, Mar 20, 2019 at 6:58 PM Cheng Fang <[hidden email]> wrote:
Hi,

I'm working on 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev


--
Brian Stansberry
Manager, Senior Principal Software Engineer
Red Hat

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev