wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes NameNotFoundException while calling EJB in JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "NameNotFoundException while calling EJB in JBOSS" Watch "NameNotFoundException while calling EJB in JBOSS" New topic
Author

NameNotFoundException while calling EJB in JBOSS

Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
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(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

when running the java file.

Please help......
Raghav Viswanathan
Greenhorn

Joined: Apr 26, 2012
Posts: 26

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,
Raghav.V


Better late than never.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NameNotFoundException while calling EJB in JBOSS
 
Similar Threads
@EJB
NameNotFoundException while calling EJB in JBOSS
javax.naming.CommunicationException
NamingContext
@EJB