5 Replies Latest reply on Apr 16, 2007 4:27 PM by Helen Tran

    javax.naming.NameNotFoundException - EJB 3.0 Enterprise Bean

    Helen Tran Newbie

      Hi All,

      I received the following error message after unsuccessfully trying to test tutorial EJB 3.0 Enterprise Beans for the JBoss Application Server (http://www.netbeans.org/kb/55/ejb30-jboss.html) by accessing servlet on http://localhost:8080/NewsApp-war/ListNews on my PC:

      type Exception report

      message

      description The server encountered an internal error () that prevented it from fulfilling this request.

      exception

      java.lang.RuntimeException: javax.naming.NameNotFoundException: NewsApp not bound
      web.ListNews.lookupNewsEntityFacade(ListNews.java:95)
      web.ListNews.processRequest(ListNews.java:48)
      web.ListNews.doGet(ListNews.java:68)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.


      I am running Netbeans 5.5, JDK 1.5.09 bundled with JBoss 4.0.4 on Windows XP.

      This is my first EJB exercise and would appreciate some guidances.

      Many thanks,

      Henry

        • 1. Re: javax.naming.NameNotFoundException - EJB 3.0 Enterprise
          Helen Tran Newbie

          Hi All,

          I managed to replacing the JNDI lookup line from java:comp/env/ejb/NewsEntityFacade to NewsApp/NewsEntityFacade/local which fixed java.lang.RuntimeException: javax.naming.NameNotFoundException error. However, I now received the following error despite having been able to access the ListNews servlet:

          HTTP Status 404 - /NewsApp-war/POstMessage
          --------------------------------------------------------------------------------
          type Status report

          message /NewsApp-war/POstMessage

          description The requested resource (/NewsApp-war/POstMessage) is not available.

          The Postmessage.java can be referenced from http://www.netbeans.org/kb/55/ejb30-jboss.html.

          Looks like this is going to be a steep learning curve for me.

          Thanks,

          Henry

          • 2. Re: javax.naming.NameNotFoundException - EJB 3.0 Enterprise
            Helen Tran Newbie

            Hi All,

            I am having difficulty verifying the greeting messages using the Database Explorer when going through the
            "EJB 3.0 Enterprise Beans for JBoss Application Server" (http://www.netbeans.org/kb/55/ejb30-jboss.html)
            tutorial.

            It is the very last step of the exercise.

            Below is the error message from Netbeans Output windows:

            --------------------------------------------------------------------------------------
            ObjectName: jboss.j2ee:ear=NewsApp.ear,jar=NewsApp-ejb.jar,name=NewsEntityFacade,service=EJB3
            State: NOTYETINSTALLED
            I Depend On:
            persistence.units:ear=NewsApp.ear,jar=NewsApp-ejb.jar,unitName=NewsApp-ejbPU

            --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
            ObjectName: jboss:service=Hypersonic,database=localDB
            State: NOTYETINSTALLED
            Depends On Me:
            jboss.jca:service=ManagedConnectionFactory,name=DefaultDS


            04:36:57,734 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
            04:36:58,312 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
            04:36:58,406 INFO [JkMain] Jk running ID=0 time=0/156 config=null
            04:36:58,453 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 55s:125ms
            04:43:27,687 ERROR [STDERR] 15/01/2007 04:43:27 web.ListNews lookupNewsEntityFacade
            SEVERE: exception caught
            javax.naming.NameNotFoundException: NewsApp 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 org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at web.ListNews.lookupNewsEntityFacade(ListNews.java:91)
            at web.ListNews.processRequest(ListNews.java:48)
            at web.ListNews.doGet(ListNews.java:68)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:595)
            04:43:28,062 ERROR [[ListNews]] Servlet.service() for servlet ListNews threw exception
            java.lang.RuntimeException: javax.naming.NameNotFoundException: NewsApp not bound
            at web.ListNews.lookupNewsEntityFacade(ListNews.java:95)
            at web.ListNews.processRequest(ListNews.java:48)
            at web.ListNews.doGet(ListNews.java:68)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.naming.NameNotFoundException: NewsApp 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 org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at web.ListNews.lookupNewsEntityFacade(ListNews.java:91)
            ... 22 more
            --------------------------------------------------------------------------------------

            Any suggestion?

            Thanks,

            Henry

            • 3. Re: javax.naming.NameNotFoundException - EJB 3.0 Enterprise
              Helen Tran Newbie

              Hi All,

              I am having difficulty verifying the greeting messages using the Database Explorer when going through the
              "EJB 3.0 Enterprise Beans for JBoss Application Server" (http://www.netbeans.org/kb/55/ejb30-jboss.html)
              tutorial.

              It is the very last step of the exercise.

              Below is the error message from Netbeans Output windows:

              --------------------------------------------------------------------------------------
              ObjectName: jboss.j2ee:ear=NewsApp.ear,jar=NewsApp-ejb.jar,name=NewsEntityFacade,service=EJB3
              State: NOTYETINSTALLED
              I Depend On:
              persistence.units:ear=NewsApp.ear,jar=NewsApp-ejb.jar,unitName=NewsApp-ejbPU

              --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
              ObjectName: jboss:service=Hypersonic,database=localDB
              State: NOTYETINSTALLED
              Depends On Me:
              jboss.jca:service=ManagedConnectionFactory,name=DefaultDS


              04:36:57,734 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
              04:36:58,312 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
              04:36:58,406 INFO [JkMain] Jk running ID=0 time=0/156 config=null
              04:36:58,453 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 55s:125ms
              04:43:27,687 ERROR [STDERR] 15/01/2007 04:43:27 web.ListNews lookupNewsEntityFacade
              SEVERE: exception caught
              javax.naming.NameNotFoundException: NewsApp 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 org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
              at javax.naming.InitialContext.lookup(InitialContext.java:351)
              at web.ListNews.lookupNewsEntityFacade(ListNews.java:91)
              at web.ListNews.processRequest(ListNews.java:48)
              at web.ListNews.doGet(ListNews.java:68)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)
              04:43:28,062 ERROR [[ListNews]] Servlet.service() for servlet ListNews threw exception
              java.lang.RuntimeException: javax.naming.NameNotFoundException: NewsApp not bound
              at web.ListNews.lookupNewsEntityFacade(ListNews.java:95)
              at web.ListNews.processRequest(ListNews.java:48)
              at web.ListNews.doGet(ListNews.java:68)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)
              Caused by: javax.naming.NameNotFoundException: NewsApp 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 org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
              at javax.naming.InitialContext.lookup(InitialContext.java:351)
              at web.ListNews.lookupNewsEntityFacade(ListNews.java:91)
              ... 22 more
              --------------------------------------------------------------------------------------

              Any suggestion?

              Thanks,

              Henry

              • 4. Re: javax.naming.NameNotFoundException - EJB 3.0 Enterprise
                arvind kumar Newbie

                hi henry,

                i am also facing the exact problem what you were facing. please help me by tellinhg that hoew you solved the problem.

                thank you very much

                • 5. Re: javax.naming.NameNotFoundException - EJB 3.0 Enterprise
                  Helen Tran Newbie

                  Hi,

                  Make sure that the Data Source field in the Persistence.xml is set to java:/DefaultDS before cleaning, rebuilding and deploying this project to resolve this issue.

                  Henry