I'm just learning EJB and towards that end I got the Dukes Bank App up and running in JBOSS and then added a jsp and a few of my own EJBs. The first bean I added was a remote stateful session bean which I accessed from the jsp I added; this worked fine. I then wrote another bean this time Extending EJBLocalObject and EJBLocalHome rather than their remote counterparts. I made what I think are the appropriate additions to the various deployment descriptors and copied the new ear file to the deploy directory. There were no deployment issues and the jboss output indicates that both beans were deployed. At runtime though when I try to access the LocalHome interface of the second bean, I get this error:
23:15:29,263 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.naming.NameNotFoundException: exitsLocalBean not bound
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
When I look at the JNDI list through the jmx-console I can see both beans listed. I did notice that the local bean is listed in the tree under a 'local' node like this:
+- local (class: org.jnp.interfaces.NamingContext)
| +- exitsLocalBean@13610862 (proxy: $Proxy103 implements interface com.exits.ejb.stateful.exitsLocalBeanHome)
Does this imply that I need to have included 'local' somewhere in jndi binding in the jboss specific deployment descriptors? I'm stuck. Help! Thanks in advance.
I solved it two minutes after (of course) I posted. The problem was that in jboss.xml I was using a <jndi-name> element rather than a <local-jndi-name> element. Thanks anyway.