This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!