• Post Reply Bookmark Topic Watch Topic
  • New Topic

exception in javax.naming  RSS feed

 
marco tognoni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I am using a servlet in J2ee, when the servlet
lookup the bean in system.err it sees :
javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:34)
at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:400)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:324)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:373)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:351)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.sun.enterprise.naming.factory.IIOPObjectFactory.getObjectInstance(IIOPObjectFactory.java:42)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:307)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:158)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:58)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at client.ComputePiServlet.init(ComputePiServlet.java:22)

I can't understand what it is.
I correctly linked the objref to my bean in servlet, then what's matter?
thanks in advance
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
problably the name you�re using to lookup the ejb is not bind to the server jndi tree, check the jndi-name of the ejb and the name you�re using to do the lookup. If you have access you should also take a look at the jndi tree of the ejb container to see if the jndi-name for the bean have been correctly binded within the server.
by
 
ipog
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way you cast the home interface should be changed..i guess CosNaming exception occurs due to Corba Java interface. Try out casting with ..
MyEjbHome home = (MyEjbHome)PortableRemoteObject.narrow(obj,MyEjbHome.class);
 
marco tognoni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,
but how can I access to the ejb container?
Is it generated by J2EE or is it a file of mine ?
 
William Dimac
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say the name is not in the namespace. You might want to try playing with Context.list() to explore what is actually there in the namespace.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!