Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean not found  RSS feed

 
Kurt Xu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm studying EJB3.0 using JBoss5. I encounter a jndi error. When I access a bean in jsp it says 'InjectionBean not bound'. But I developed another EJB using jnid of the same rule it worked.

below is the code:

Injection:


InjectionBean:


invoker, a jsp:


I don't define a ejb-jar.xml, for EJB3.0 it's not a must.According jboss docs, default ejb jndi should be ejb-name/remote, anybody with any ideas? thanks.





 
Nick Potter
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Injection injection = (Injection) ctx.lookup("InjectionBean/remote");

If you don't define the mappedName of the ejb, jboss defaults the JNDIName to application/implementation bean name/type of ejb

meaning, if your app gets deployed as foshanshop, your ejb name is foshanshop/InjectionBean/remote
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!