4 Replies Latest reply on Sep 7, 2005 8:16 AM by oglueck

    EJB3StandaloneDeployer: NameNotFoundException

    khalidhajsaleh

      I am trying to run the archive example of the EJB3StandaloneDeployer from eclipse. When I run the main class, I keep on getting the error:

      Exception in thread "main" javax.naming.NameNotFoundException: DefaultDS not bound

      I would appreciate any help.

      Khalid

        • 1. Re: EJB3StandaloneDeployer: NameNotFoundException
          bill.burke

          Are you getting any exceptions thrown? Is the conf/ directory of the distribution in your classpath? Are you running the archive example as-is? If you figure this out, would you be willing to write something for our WIKI? I don't use eclipse .

          • 2. Re: EJB3StandaloneDeployer: NameNotFoundException
            khalidhajsaleh

            Bill,

            I will be glad to write something in the wiki once I get this working.

            I added my config directory to my class path but that did not change anything. I am getting the following errors throw when I run the example.

            Exception in thread "main" java.lang.RuntimeException: unable to find: java:/managedEntityFactories/DefaultDS
             at org.jboss.ejb3.injection.PersistenceContextHandler.getManagedEntityManagerFactory(PersistenceContextHandler.java:85)
             at org.jboss.ejb3.injection.PersistenceContextHandler.loadFieldInjectors(PersistenceContextHandler.java:169)
             at org.jboss.ejb3.injection.PersistenceContextHandler.loadInjectors(PersistenceContextHandler.java:134)
             at org.jboss.ejb3.EJBContainer.resolveInjectors(EJBContainer.java:300)
             at org.jboss.ejb3.EJBContainer.initializePool(EJBContainer.java:238)
             at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:208)
             at org.jboss.ejb3.SessionContainer.start(SessionContainer.java:43)
             at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:64)
             at org.jboss.ejb3.stateless.StatelessManager.startService(StatelessManager.java:88)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:287)
             at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:187)
             at org.jboss.ejb3.embedded.EJB3StandaloneDeployment.start(EJB3StandaloneDeployment.java:96)
             at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:398)
             at org.jboss.tutorial.archive.Main.main(Main.java:40)
            Caused by: javax.naming.NameNotFoundException: DefaultDS not bound
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
             at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
             at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
             at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
             at javax.naming.InitialContext.lookup(Unknown Source)
             at org.jboss.ejb3.injection.PersistenceContextHandler.getManagedEntityManagerFactory(PersistenceContextHandler.java:81)
             ... 13 more


            At some point I had changed the embedded-jboss-beans.xml to point to a myql database and changed the JNDI name. So there was java:/DefaultDS defined in embedded-jboss-beans.xml. At that point, I was getting a different error:

            Exception in thread "main" javax.naming.NameNotFoundException: DefaultDS not bound
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
             at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
             at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
             at javax.naming.InitialContext.lookup(Unknown Source)
             at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:481)1: sun.misc.Launcher$AppClassLoader@133056f
            resourcesresourcesresourcesresources: file:/C:/javatest/archive/build/classes/resources/META-INF/persistence.xml
            
             at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:242)
             at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:390)
             at org.jboss.tutorial.archive.Main.main(Main.java:39)


            I figured that for now, it is better to get the example to run as is but thought you might want to know.

            thanks for the help.

            Khalid

            • 3. Re: EJB3StandaloneDeployer: NameNotFoundException

              I get this exception when I forget to ad an Id to an entity. Make sure all your entities have an Id property that is correctly annotated.

              • 4. Re: EJB3StandaloneDeployer: NameNotFoundException