• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NameNotFoundException while calling EJB in JBOSS

 
Suhas Mohamedali
Greenhorn
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(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
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,
Raghav.V
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic