1 Reply Latest reply on Nov 16, 2004 3:17 AM by Bernd Zeitler

    javax.naming.NameNotFoundException: ejb not bound

    hanssack Newbie

      Hey group,

      I'm trying to access a simple Session Bean via JNDI. I'm using JBoss 3.2.6 and everytime the lookup is performed, I get an exception "ejb not bound" I already searched all the other newsgroup entries, but I couldn't find anything fixing my problem. The strange this is, that the EJB seems to be deployed correctly (I can invoke the start, stop... methods from the jmx console.) I deployed a diffrent EJB project I which I wrote earlier and which worked fine under JBoss 3.2.3 and got the same exception. One thing I recognized is, that in the JBoss Console output I only get a message "15:07:58,403 INFO [EjbModule] Deploying HelloWorldBean" shouldn't there be some more messages telling, that the bean was bound, startet, initialized and so on ?

      This is the stacktrace I receive:
      javax.naming.NameNotFoundException: ejb not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:490)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:498)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:504)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:248)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:534)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
      at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(Unknown Source)

      It seems, that my ejb-jar and jboss.xml files are correct, I generated them using MyEclipse and XDoclet. The JNDI-name I use is the same as in the jboss.xml (but I also tried it without the "ejb/"- prefix)
      This is the code I wrote:

      Hashtable properties = new Hashtable();

      InitialContext initialContext = new InitialContext(properties);
      Object o = initialContext.lookup("ejb/HelloWorldLocatorBeanHome");

      Any help would be greatly apprecheated !
      Many Thx and best regards,