<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 20, 2019 at 6:58 PM Cheng Fang <<a href="mailto:cfang@redhat.com">cfang@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:georgia,serif;font-size:large">Hi,</div><div style="font-family:georgia,serif;font-size:large"><br></div><div><span style="font-family:georgia,serif;font-size:large">I'm working on </span><font face="georgia, serif" size="4"><a href="https://issues.jboss.org/browse/WFLY-11808" target="_blank">WFLY-11808</a> (</font><span style="font-family:georgia,serif;font-size:large">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. </span></div><div><span style="font-family:georgia,serif;font-size:large"><br></span></div><div><span style="font-family:georgia,serif;font-size:large">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.</span></div><div><span style="font-family:georgia,serif;font-size:large"><br></span></div><div><span style="font-family:georgia,serif;font-size:large">In batch subsystem, it assigns the name context for the job execution by calling:</span></div><div><span style="font-family:georgia,serif;font-size:large"><br></span></div><div><font face="georgia, serif" size="4">NamespaceContextSelector.getCurrentSelector();</font><br></div><div><font face="georgia, serif" size="4"><br></font></div><div><font face="georgia, serif" size="4">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.</font></div><div><font face="georgia, serif" size="4"><br></font></div><div><font face="georgia, serif" size="4">Is there a way to select the name context associated with the deployment that contains the batch job?</font></div><div></div></div></div></div></blockquote><div><br></div><div class="gmail_default"><font face="trebuchet ms, sans-serif">Unfortunately, there isn't a NamespaceContextSelector for a deployment overall. There's the default selector (which I assume is what </font>NamespaceContextSelector.getCurrentSelector() is returning now for this case) and then there are per-EE-component selectors (see NamespaceConfigurator.configure<span style="color:rgb(0,0,0);font-family:Menlo;font-size:9pt">)</span>.</div><div class="gmail_default"><br></div><div class="gmail_default">I don't know if what Eduardo Martins is doing on <a href="https://issues.jboss.org/browse/WFLY-9529">https://issues.jboss.org/browse/WFLY-9529</a> may help somewhat, i.e. by making some commonly requested bindings visible when the thread is handling a from an EE component.</div><div class="gmail_default"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div> <br></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="georgia, serif" size="4"></font></div><div><font face="georgia, serif" size="4">Thanks,</font></div><div><font face="georgia, serif" size="4">Cheng</font></div><div><span style="font-family:georgia,serif;font-size:large"><br></span></div><div><span style="font-family:georgia,serif;font-size:large"><br></span></div></div></div></div>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Brian Stansberry<div>Manager, Senior Principal Software Engineer</div><div>Red Hat</div></div></div></div></div>