• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3 session bean lookup problem from jsp

 
mach zro
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to write a simple stateless EJB 3 with weblogic 10.3 and JDK 1.6_05.

My bussiness interface is

businessLogicBean

JSP code :

ejb-jar.xml


but gettin error
javax.naming.NameNotFoundException: While trying to lookup 'example.ejb.session.Hello' didn't find subcontext 'example'. Resolved ''; remaining name 'example/ejb/session/Hello'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)

I dont know where i am going wrong? please help
 
mach zro
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Waiting for reply
 
rajan patil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try following to lookup:
Hello hello=(Hello)ctx.lookup("HelloBean");

if you still getting exception then check your global jndi tree in weblogic and use that name.
By looking at your code it seems that your ejbs jndi name should be HelloBean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic