File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB3 and JBoss 6 NameNotFoundException 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 and JBoss 6 NameNotFoundException" Watch "EJB3 and JBoss 6 NameNotFoundException" New topic
Author

EJB3 and JBoss 6 NameNotFoundException

vibeeshan kambli
Ranch Hand

Joined: Jan 22, 2003
Posts: 41
Hi ,
I am trying to work with one of my new application to JBoss AS 6 inside the eclipse.
I have a ejb 3 session bean, I am trying to look it up in my struts 2 action class

InitialContext ctx = new InitialContext();
Object remote = ctx.lookup(beanId);

where bean id is jGurukulEar/LoginServiceImpl/remote ( <ear-file-name>/<ejb-name>/remote)
I am getting NameNotFoundException. I verified jboss jmx-consile , the session bean bounded with jndi name GurukulEar/LoginServiceImpl/remote
I tried to look it up using jndi name using java:comp/env/GurukulEar/LoginServiceImpl/remote still not working
What could be going wrong here ?



javax.naming.NameNotFoundException: EAR not bound
org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
org.jnp.server.NamingServer.getObject(NamingServer.java:785)
org.jnp.server.NamingServer.lookup(NamingServer.java:396)
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
javax.naming.InitialContext.lookup(Unknown Source)
com.bht.gurukul.common.ServiceLocator.getSessionBean(ServiceLocator.java:58)
com.bht.gurukul.action.LoginAction.execute(LoginAction.java:23)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

Ran Pleasant
Ranch Hand

Joined: Jan 16, 2003
Posts: 75
Vibeeshan

I recently encountered the same problem using EJB 3.0 in JBoss AS 6. The only solution I found was to remove the name annotation from the bean, leaving only "@Session". After changing your EJB use the JNDI Viewer on the JBoss console to see the valid name.

If I actually named my EJB something like "java:ejb/MyDoSomethingService" I not able connect to it using anything of the names in the JNDI. The JNDI Viewer showed the bean was loaded but I just couldn't get it.

Ran
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB3 and JBoss 6 NameNotFoundException