Two Laptop Bag*
The moose likes EJB and other Java EE Technologies and the fly likes EJB3 session bean lookup problem from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB3 session bean lookup problem from jsp" Watch "EJB3 session bean lookup problem from jsp" New topic
Author

EJB3 session bean lookup problem from jsp

mach zro
Greenhorn

Joined: Jul 08, 2010
Posts: 4
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

Joined: Jul 08, 2010
Posts: 4
Waiting for reply
rajan patil
Greenhorn

Joined: Feb 28, 2010
Posts: 3
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB3 session bean lookup problem from jsp
 
Similar Threads
deployment descriptor (ejb-jar.xml) problem
weblogic 9 deployment error
NameNotFoundException: 'ordermanagementLocal'
Can't connect (ejb - glassfish) and (ejb client - weblogic)
Help executing an EJB persistence application