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

JNDI lookup error

22 views
Skip to first unread message

Shabbir Mala

unread,
Aug 26, 2006, 7:06:07 PM8/26/06
to
I am new to Websphere and require help from group members. The problem
which i am facing is -

1. I have made two EAR application and trying to use a bean from first
application in the second one. On Web deployment descriptor GUI, I am
trying to add EJB Reference in the References tab. I did added a new
reference and linked on 'Browse' button to select a bean. On click it
is not showing me the first application bean, but after adding
configuring the bean reference in the second application, i am not able
to see the bean in the beans list after clicking 'Browse' button. But
when i add my second application in the application.xml (EAR deployment
descriptor) i am able to see the beans from my first application. Is
this the right process which i am doing?

2. If i dont added the module in the EAR deployment descriptor as
explained in the first step and try to do a lookup by changing the
web.xml of the second application with the <ejb-ref> description, and
calling the EJB using - java:comp/env/ejb/VascoMain.. it throws an
error.

The Error is -
[8/26/06 17:47:18:977 CDT] 583e62f9 Helpers W NMSV0605W: A
Reference object looked up from the context "java:" with the name
"comp/env/ejb/VascoMain" was sent to the JNDI Naming Manager and an
exception resulted. Reference data follows:
Reference Factory Class Name:
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object
Type: JndiLookupInfo
Content: JndiLookupInfo: jndiName="ejb/VascoMain"; providerURL="";
initialContextFactory=""

Exception data follows:
javax.naming.NameNotFoundException: Context:
localhost/nodes/localhost/servers/server1, name: ejb/VascoMain: First
component in name VascoMain 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_resolve_complete_info(WsnOptimizedNamingImpl.java:968)
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1431)
at
com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown
Source)
at
com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3493)
at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1521)
at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1482)
at
com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1189)
at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372)
at
com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221)
at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:889)
at
com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:152)
at
com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(javaURLContextRoot.java:398)
at
com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278)
at
com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:196)
at
com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:137)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at com.abnamro.na.vasco.servlet.login.getRemoteHome(login.java:37)
at
com.abnamro.na.vasco.servlet.loginServlet.doPost(loginServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java: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.service(StrictLifecycleServlet.java:313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1171)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:676)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:203)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:300)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:246)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:458)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:936)

[8/26/06 17:47:19:024 CDT] 583e62f9 Helpers W NMSV0610I: A
NamingException is being thrown from a javax.naming.Context
implementation. Details follow:
Context implementation: com.ibm.ws.naming.java.javaURLContextRoot
Context method: lookup(Name)
Context name: java:
Target name: comp/env/ejb/VascoMain
Other data:
Exception stack trace:
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
occurred while the JNDI NamingManager was processing a
javax.naming.Reference object. Root exception is
javax.naming.NameNotFoundException: Context:
localhost/nodes/localhost/servers/server1, name: ejb/VascoMain: First
component in name VascoMain 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_resolve_complete_info(WsnOptimizedNamingImpl.java:968)
at
com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1431)
at
com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown
Source)
at
com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3493)
at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1521)
at
com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1482)
at
com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1189)
at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372)
at
com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221)
at
com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:889)
at
com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:152)
at
com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(javaURLContextRoot.java:398)
at
com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278)
at
com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:196)
at
com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:137)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at com.abnamro.na.vasco.servlet.login.getRemoteHome(login.java:37)
at
com.abnamro.na.vasco.servlet.loginServlet.doPost(loginServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java: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.service(StrictLifecycleServlet.java:313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1171)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:676)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:203)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:300)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:246)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:458)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:936)


Please help me on this since i am struggling with this issue from last
2days and have not being able to resolve it.

Thanks in adv.
Shabbir

Omri

unread,
Aug 27, 2006, 3:51:51 AM8/27/06
to
Hi,
You cannot use java:comp/env.. if you do not add the reference to the
applcations web.xml.
I'm not sure i understood exactly what you did but try this:
create an ejb-client jar, from the ejb project you want to call to ( if
app1 uses app2 than create ejb client jar from app 2) you can do this
by right clicking the ejb project.
You can add the ejb client jar to the OTHER ear project. and to it's
build path. This should make the use of the second ejb possible from
the first one.
dont forget PortableRemoteObject.narrow.

good luck.

Shabbir Mala

unread,
Aug 28, 2006, 3:40:33 PM8/28/06
to
Thanks. I will try and will let you know.. if any further problems.

thanks again..

0 new messages