Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JNDI operation on a "java:"

110 views
Skip to first unread message

mueller johanna

unread,
Dec 2, 2009, 3:55:32 AM12/2/09
to
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.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:420)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:398)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:214)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:154)
at javax.naming.InitialContext.lookup(InitialContext.java:450)
at com.ibm.www.BFMIFProxy._initBFMIFProxy(BFMIFProxy.java:17)
at com.ibm.www.BFMIFProxy.(BFMIFProxy.java:9)
at de.huk.safir.wps.WPSInterface.startProcess(WPSInterface.java:152)
at de.huk.safir.wps.console.WPSConsoleBCImpl.startTask(WPSConsoleBCImpl.java:196)
at de.huk.safir.wps.console.WPSConsoleBCImpl.openLink(WPSConsoleBCImpl.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at fw.base.mthdex.MethodExecutorImpl.execute(MethodExecutorImpl.java:54)
at fw.base.cmd.CommandImpl.execute(CommandImpl.java:175)
at fw.base.cmd.CommandImpl.execute(CommandImpl.java:163)
at fw.base.cmpadp.ActionTriggerAdaptor.doExecuteActionCommand(ActionTriggerAdaptor.java:67)
at fw.base.cmpadp.ActionTriggerAdaptor.executeActionCommand(ActionTriggerAdaptor.java:47)
at fw.base.cmpadp.ActionTriggerAdaptor.perform(ActionTriggerAdaptor.java:31)
at fw.base.itype.jsf.html.HtmlCommandButtonIType.perform(HtmlCommandButtonIType.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(MethodExpressionImpl.java:277)
at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at fw.base.jsf.application.SafirThreadMethodBinding.doRun(SafirThreadMethodBinding.java:37)
at fw.base.jsf.application.SafirThread.run(SafirThread.java:67)
Caused by: javax.naming.NameNotFoundException: Name comp/env/service not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1837)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1166)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1095)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1233)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:394)
... 28 more

0 new messages