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 ?
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.