|
| Re: jndi at WSAD |
 |
Tue, 19 Jun 2007 17:01:01 EDT |
Following can be checked:
1. Make sure your JNDI names in both EJB Deployment Descriptor (EJBs) and Client
Deployment Descriptor (EJB References) are identical (i.e, ejb/SomeEjbHome).
2. Make sure that the lookup() method call's argument is identical to the JNDI
name of the EJB (i.e, ejb/SomeEjbHome).
3. Can see the dump of the initial context on the command line to see whether
the ejb is bound to the context (run dumpNameSpace.bat -startAt
localhost/nodes/localhost/servers/server1, for windows, and see whether your ejb
is bound)
4. Try using java:comp/env/ejb/SomeEjbHome for context lookup
5. Try setting the INITIAL_CONTEXT_FACTORY to
com.ibm.websphere.naming.WsnInitialContextFactory and provide your PROVIDER_URL
as environment variables to initial context, actually this is taken up as
default by WSAD.
6. Make sure your Server is up and running.
> Hi to all.
> I have a servlet with this lines:
> InitialContext initCtx = new InitialContext(env);
> Object ref = initCtx.lookup("USER");
>
> and i have an ejb with file: ibm-ejb-jar-bnd.xmi
> with line look like this:
> jndiName="USER"
>
> why i have an error message:
> javax.naming.NameNotFoundException: Context:
> localhost/nodes/localhost/servers/server1, name:
> USER: First component in name USER not found. Root
> exception is
> org.omg.CosNaming.NamingContextPackage.NotFound:
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 at
> com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_reso
> lve_complete_info(WsnOptimizedNamingImpl.java:968) at
> com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.r
> esolve_complete_info(WsnOptimizedNamingImplBase.java:1
> 399) at
> com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_
> complete_info(Unknown Source) at
> com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNC
> ontextImpl.java:3491) at
> com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNCon
> textImpl.java:1519) at
> com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNCon
> textImpl.java:1480) at
> com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNCo
> ntextImpl.java:1187) at
> com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNConte
> xtImpl.java:1067) at
> com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.ja
> va:132) at
> javax.naming.InitialContext.lookup(InitialContext.java
> :360) at
> servlets.ZNewMember.check(ZNewMember.java:53) at
> servlets.ZNewMember.doGet(ZNewMember.java:25) at
> servlets.ZNewMember.doPost(ZNewMember.java:102) at
> javax.servlet.http.HttpServlet.service(HttpServlet.jav
> a:760) at
> javax.servlet.http.HttpServlet.service(HttpServlet.jav
> a:853) at
> com.ibm.ws.webcontainer.servlet.StrictServletInstance.
> doService(StrictServletInstance.java:110) at
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet
> ._service(StrictLifecycleServlet.java:174) at
> com.ibm.ws.webcontainer.servlet.IdleServletState.servi
> ce(StrictLifecycleServlet.java:313) at
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet
> .service(StrictLifecycleServlet.java:116) at
> com.ibm.ws.webcontainer.servlet.ServletInstance.servic
> e(ServletInstance.java:283) at
> com.ibm.ws.webcontainer.servlet.ValidServletReferenceS
> tate.dispatch(ValidServletReferenceState.java:42) at
> com.ibm.ws.webcontainer.servlet.ServletInstanceReferen
> ce.dispatch(ServletInstanceReference.java:40) at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher
> .handleWebAppDispatch(WebAppRequestDispatcher.java:983
> ) at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher
> .dispatch(WebAppRequestDispatcher.java:564) at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher
> .forward(WebAppRequestDispatcher.java:200) at
> com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(We
> bAppInvoker.java:119) at
> com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvoca
> tionHook(WebAppInvoker.java:276) at
> com.ibm.ws.webcontainer.cache.invocation.CachedInvocat
> ion.handleInvocation(CachedInvocation.java:71) at
> com.ibm.ws.webcontainer.cache.invocation.CacheableInvo
> cationContext.invoke(CacheableInvocationContext.java:1
> 16) at
> com.ibm.ws.webcontainer.srp.ServletRequestProcessor.di
> spatchByURI(ServletRequestProcessor.java:186) at
> com.ibm.ws.webcontainer.oselistener.OSEListenerDispatc
> her.service(OSEListener.java:334) at
> com.ibm.ws.webcontainer.http.HttpConnection.handleRequ
> est(HttpConnection.java:56) at
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(Ht
> tpConnection.java:618) at
> com.ibm.ws.http.HttpConnection.run(HttpConnection.java
> :443) at
> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(
> Compiled Code))
> thanks.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|