1 Reply Latest reply on Dec 30, 2004 9:50 AM by Juha Lindfors

    NameNotFoundException

    pre san Newbie

      I tried executing the code given at the end and i am getting following error.I even tried giving JNDI name as java:comp/env/ejb/AccountLocalEjb

      Error shown in server console
      javax.naming.NameNotFoundException: jboss:AccountLocalEjb not bound
      09:47:32,345 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      09:47:32,345 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      09:47:32,345 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      09:47:32,345 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      09:47:32,345 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:47:32,345 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:47:32,345 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:47:32,345 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
      09:47:32,345 INFO [STDOUT] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      09:47:32,345 INFO [STDOUT] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      09:47:32,345 INFO [STDOUT] at java.security.AccessController.doPrivileged(Native Method)
      09:47:32,345 INFO [STDOUT] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      09:47:32,345 INFO [STDOUT] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      09:47:32,345 INFO [STDOUT] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      09:47:32,345 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
      09:47:32,345 INFO [STDOUT] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
      09:47:32,345 INFO [STDOUT] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
      09:47:32,345 INFO [STDOUT] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      09:47:32,345 INFO [STDOUT] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      09:47:32,345 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:529)
      09:47:32,345 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
      09:47:32,345 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      09:47:32,345 INFO [STDOUT] at main.customer.servlet.CustomerServlet.init(CustomerServlet.java:53)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      09:47:32,345 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      09:47:32,345 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      09:47:32,345 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      09:47:32,345 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      09:47:32,345 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      09:47:32,345 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      09:47:32,345 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      09:47:32,345 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      09:47:32,345 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)



      My Client code:
      try {
      Properties p= new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      p.put(Context.PROVIDER_URL,"localhost:1099");
      Context ctx = new InitialContext(p);
      Object objref = ctx.lookup("AccountLocalEjb");
      accountLocalHome = (AccountLocalHome)PortableRemoteObject.narrow(objref,AccountLocalHome.class);
      } catch (Exception NamingException) {
      NamingException.printStackTrace();
      My JBOSS.xml


      <unauthenticated-principal>nobody</unauthenticated-principal>

      <enterprise-beans>

      <ejb-name>AccountLocalEjb</ejb-name>
      <local-jndi-name>AccountLocalEjb</local-jndi-name>


      </enterprise-beans>

      <resource-managers>
      </resource-managers>



      My ejb-jar.xml


      <ejb-jar >

      <![CDATA[No Description.]]>
      <display-name>Generated by XDoclet</display-name>

      <enterprise-beans>

      <!-- Session Beans -->

      <ejb-name>AccountLocalEjb</ejb-name>
      <local-home>main.customer.session.AccountLocalHome</local-home>
      main.customer.session.AccountLocal
      <ejb-class>main.customer.session.AccountLocalEjb</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-local-ref>
      <ejb-ref-name>AccountLocalEjb</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>main.customer.session.AccountLocalHome</local-home>
      main.customer.session.AccountLocal
      <ejb-link>AccountLocalEjb</ejb-link>
      </ejb-local-ref>



      </enterprise-beans>

      <!-- Relationships -->

      <!-- Assembly Descriptor -->
      <assembly-descriptor >
      </assembly-descriptor>

      </ejb-jar>

      Thanks in Advance
      Pre