7 Replies Latest reply on Feb 11, 2009 10:41 AM by peterj

    naming.NameNotFoundException problem

      When running my client i get the following excetion -

      javax.naming.NameNotFoundException: CustomerRemoteHome 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:296)
       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:597)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
       at sun.rmi.transport.Transport$1.run(Transport.java:159)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
       at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at com.titan.customer.Client.main(Client.java:18)
      


      I'm using the following properties for the Context initialation:
      Properties env = new Properties();
       env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
       env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
       return new InitialContext(env);
      

      How it can be solved?
      Thanks.

        • 1. Re: naming.NameNotFoundException problem
          peterj

          Use JNDIView to see what name the EJB is registered under and correct the name in your client. See http://www.jboss.org/community/docs/DOC-9583

          • 2. Re: naming.NameNotFoundException problem

            How can the following configuration can help me with solving my problem that i have described above?

            +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
             +- jmx (class: org.jnp.interfaces.NamingContext)
             | +- invoker (class: org.jnp.interfaces.NamingContext)
             | | +- RMIAdaptor (proxy: $Proxy35 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
             | +- rmi (class: org.jnp.interfaces.NamingContext)
             | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
             +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
             +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
             +- UserTransactionSessionFactory (proxy: $Proxy44 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
             +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
             +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
             +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
             +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
             +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
             +- queue (class: org.jnp.interfaces.NamingContext)
             | +- A (class: org.jboss.mq.SpyQueue)
             | +- testQueue (class: org.jboss.mq.SpyQueue)
             | +- ex (class: org.jboss.mq.SpyQueue)
             | +- DLQ (class: org.jboss.mq.SpyQueue)
             | +- D (class: org.jboss.mq.SpyQueue)
             | +- C (class: org.jboss.mq.SpyQueue)
             | +- B (class: org.jboss.mq.SpyQueue)
             +- topic (class: org.jnp.interfaces.NamingContext)
             | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
             | +- testTopic (class: org.jboss.mq.SpyTopic)
             | +- securedTopic (class: org.jboss.mq.SpyTopic)
             +- console (class: org.jnp.interfaces.NamingContext)
             | +- PluginManager (proxy: $Proxy36 implements interface org.jboss.console.manager.PluginManagerMBean)
             +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
             +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
             +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
             +- EventDispatcher (class: org.jboss.ws.eventing.mgmt.DispatcherDelegate)
             +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
             +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
            


            • 3. Re: naming.NameNotFoundException problem
              peterj

              I will answer your question with another question: these are all of the names registered in JNDI, what is missing?

              Answer: Your client is attempting to look up an EJB that apparently was never deployed and thus is not in JNDI and therefore cannot be looked up.

              • 4. Re: naming.NameNotFoundException problem

                I'm trying to run my client from Netbeans 6.5 IDE.
                This exception thrown within the IDE.
                How can I debug my application?
                Thanks,
                Eyal.

                • 5. Re: naming.NameNotFoundException problem
                  peterj

                  Within NetBeans? I have no idea.

                  Have you attempted to deploy the EJB? Does tha EJB deploy successfully or do you get errors? Until you can locate the EJB in the JNDIView, your client code will continue to fail.

                  • 6. Re: naming.NameNotFoundException problem

                    What IDE is recommended to work with JBoss?
                    I prefer to work with more suit tool.

                    • 7. Re: naming.NameNotFoundException problem
                      peterj

                      Try Eclipse with the JBoss Tools plugin.

                      But if you are new to this, I really recommend that you do things by hand. Here's what I do. I use the IDE to edit the Java source files and config files. I use either Maven or Ant to build the EJB JAR file and the client. I manually copy the EJB JAR file to JBoss AS. And I run the client from a command line.