• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB3 and JBoss 6 NameNotFoundException

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic