This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
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