This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NameNotFoundException while calling EJB in JBOSS  RSS feed

Suhas Mohamedali
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My EJB jar is packaged in EAR and deployed succesfullt in JBOSS.

Now I am run a java class like below.

Now I am getting javax.naming.NameNotFoundException: AreaBean not bound
at org.jnp.server.NamingServer.getBinding(
at org.jnp.server.NamingServer.getBinding(
at org.jnp.server.NamingServer.getObject(
at org.jnp.server.NamingServer.lookup(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

when running the java file.

Please help......
Raghav Viswanathan
Posts: 26
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Suhas,

Issue seems to be with your JNDI name. Kindly check your console again as to what your JNDI name was when the EJB got deployed.

This post has no information about the environment. Kindly let us know about the environment (Version of JBOSS and Version of EJB )being used. Please note that post JEE6 JBOSS the defult bindings have changed a lot. Kindly check the JEE6 specification for more details (If your JBOSS is running on either 6 or 7).

For instance in JBOSS 5 the bindings happen as follows

RemoteClassName/remote (please note class name here is not fully qualified class name). You can check the JNDI name in the trace while its getting deployed. A sample is given below.

15:21:36,237 INFO [JBossASKernel] Created KernelDeployment for: SmapleEJB.jar
15:21:36,237 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=SmapleEJB.jar,name=SmpleEJBBean,service=EJB3
15:21:36,237 INFO [JBossASKernel] with dependencies:
15:21:36,237 INFO [JBossASKernel] and demands:
15:21:36,237 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
15:21:36,237 INFO [JBossASKernel] and supplies:
15:21:36,237 INFO [JBossASKernel] Class:de.dl.hex.sample.SmpleEJBRemote
15:21:36,237 INFO [JBossASKernel] jndi:SmpleEJBBean/remote-de.dl.hex.sample.SmpleEJBRemote
15:21:36,237 INFO [JBossASKernel] jndi:SmpleEJBBean/remote
15:21:36,237 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=SmapleEJB.jar,name=SmpleEJBBean,service=EJB3) to KernelDeployment of: SmapleEJB.jar
15:21:36,267 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=SmapleEJB.jar,name=SmpleEJBBean,service=EJB3
15:21:36,267 INFO [EJBContainer] STARTED EJB: de.dl.hex.sample.SmpleEJBBean ejbName: SmpleEJBBean
15:21:36,267 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

SmpleEJBBean/remote - EJB3.x Default Remote Business Interface
SmpleEJBBean/remote-de.dl.hex.sample.SmpleEJBRemote - EJB3.x Remote Business Interface

The ones in bold denote the JNDI Names. You can use both of them to invoke.

Hope this helps

Thanks and regards,
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!