Hello,

I need to do a web service call which uses a jndi lookup like this: ctx.lookup("java:comp/env/service/HTMWSService")).getHTMWSPort();
Due to the calling application I have to to this from within a thread which is not the application thread.

Is there a possibility to relate the new thread to the context and how can this be done?
Is there another way to do the lookup?

Thank you for help
j.m.


[02.12.09 09:34:08:493 CET] 00000029 javaURLContex E NMSV0310E: A JNDI operation on a "java:" name cannot be completed because the server runtime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. Exception stack trace:
javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException: Name comp/env/service not found in context "java:".]
at com.ibm.ws.naming.java.javaURLContextImpl.throwCon figurationExceptionWithDefaultJavaNS(javaURLContex tImpl.java:420)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(j avaURLContextImpl.java:398)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(j avaURLContextRoot.java:214)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(j avaURLContextRoot.java:154)
at javax.naming.InitialContext.lookup(InitialContext. java:450)
at com.ibm.http://www.BFMIFProxy._initBFMIFProx...FProxy.java:17)
at com.ibm.www.BFMIFProxy.(BFMIFProxy.java:9)
at de.huk.safir.wps.WPSInterface.startProcess(WPSInte rface.java:152)
at de.huk.safir.wps.console.WPSConsoleBCImpl.startTas k(WPSConsoleBCImpl.java:196)
at de.huk.safir.wps.console.WPSConsoleBCImpl.openLink (WPSConsoleBCImpl.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at fw.base.mthdex.MethodExecutorImpl.execute(MethodEx ecutorImpl.java:54)
at fw.base.cmd.CommandImpl.execute(CommandImpl.java:1 75)
at fw.base.cmd.CommandImpl.execute(CommandImpl.java:1 63)
at fw.base.cmpadp.ActionTriggerAdaptor.doExecuteActio nCommand(ActionTriggerAdaptor.java:67)
at fw.base.cmpadp.ActionTriggerAdaptor.executeActionC ommand(ActionTriggerAdaptor.java:47)
at fw.base.cmpadp.ActionTriggerAdaptor.perform(Action TriggerAdaptor.java:31)
at fw.base.itype.jsf.html.HtmlCommandButtonIType.perf orm(HtmlCommandButtonIType.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.apache.el.parser.AstValue.invoke(AstValue.java :131)
at org.apache.el.MethodExpressionImpl.invoke(MethodEx pressionImpl.java:277)
at com.sun.faces.application.MethodBindingMethodExpre ssionAdapter.invoke(MethodBindingMethodExpressionA dapter.java:88)
at fw.base.jsf.application.SafirThreadMethodBinding.d oRun(SafirThreadMethodBinding.java:37)
at fw.base.jsf.application.SafirThread.run(SafirThrea d.java:67)
Caused by: javax.naming.NameNotFoundException: Name comp/env/service not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInt ernal(NameSpace.java:1837)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal( NameSpace.java:1166)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpac e.java:1095)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(Ur lContextImpl.java:1233)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(j avaURLContextImpl.java:394)
... 28 more