1 Reply Latest reply on Apr 23, 2006 4:33 PM by gavin.king

    Tomcat JNDI Problem w/ Booking-Example

    elgamal

      Hello,

      I am trying to get the Booking Demo to work. I am using Eclipse with the Exadel Studio 3.5 Free Version. I created a new project, added all necessary files following the configuration closely. Deployment to Tomcat works, but when I try to register as a new user I get a javax.naming.NameNotFoundException Error.
      I am using the following:

      Tomcat 5.5 with EmbedabbleEJB
      Seam CVS20060421

      When i browse to the booking-demo and then try to register a new user i get the following error:

      Stack-Trace

      ERROR 23-04 15:04:56,828 (StandardWrapperValve.java:invoke:253) -Servlet.service() for servlet Faces Servlet threw exception
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
       at org.jboss.seam.Component.newInstance(Component.java:628)
       at org.jboss.seam.Component.newInstance(Component.java:1137)
       at org.jboss.seam.Component.getInstance(Component.java:1088)
       at org.jboss.seam.Component.getInstance(Component.java:1071)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:41)
       at com.sun.el.parser.AstValue.getTarget(AstValue.java:41)
       at com.sun.el.parser.AstValue.getType(AstValue.java:34)
       at com.sun.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:171)
       at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:60)
       at com.sun.facelets.el.LegacyValueBinding.getType(LegacyValueBinding.java:94)
       at org.apache.myfaces.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:55)
       at org.apache.myfaces.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:324)
       at org.apache.myfaces.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:643)
       at org.apache.myfaces.renderkit.html.HtmlSecretRendererBase.getConvertedValue(HtmlSecretRendererBase.java:103)
       at javax.faces.component.UIInput.getConvertedValue(UIInput.java:289)
       at javax.faces.component.UIInput.validate(UIInput.java:265)
       at javax.faces.component.UIInput.processValidators(UIInput.java:144)
       at javax.faces.component.UIForm.processValidators(UIForm.java:68)
       at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417)
       at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:142)
       at org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23)
       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.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:868)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.naming.NameNotFoundException: RegisterAction 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 org.jboss.seam.Component.instantiate(Component.java:668)
       at org.jboss.seam.Component.newInstance(Component.java:624)
       ... 41 more


      Her is an excerpt of the startup process:
      INFO 23-04 15:04:42,031 (Component.java:<init>:171) -Component: bookingList, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.BookingListAction, JNDI: BookingListAction/local
      INFO 23-04 15:04:42,046 (Component.java:<init>:171) -Component: register, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.RegisterAction, JNDI: RegisterAction/local
      INFO 23-04 15:04:42,046 (Component.java:<init>:171) -Component: changePassword, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.ChangePasswordAction, JNDI: ChangePasswordAction/local
      INFO 23-04 15:04:42,062 (Component.java:<init>:171) -Component: hotelBooking, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.HotelBookingAction, JNDI: HotelBookingAction/local
      INFO 23-04 15:04:42,078 (Component.java:<init>:171) -Component: user, scope: SESSION, type: ENTITY_BEAN, class: org.jboss.seam.example.booking.User
      INFO 23-04 15:04:42,078 (Component.java:<init>:171) -Component: booking, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.booking.Booking
      INFO 23-04 15:04:42,125 (Component.java:<init>:171) -Component: login, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.jboss.seam.example.booking.LoginAction, JNDI: LoginAction/local
      INFO 23-04 15:04:42,125 (Ejb.java:startup:37) -starting the embedded EJB container
      WARN 23-04 15:04:42,656 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
      INFO 23-04 15:04:43,015 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
      INFO 23-04 15:04:43,234 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/bookingDatasource'
      INFO 23-04 15:04:43,718 (Ejb3Deployment.java:create:465) -EJB3 deployment time took: 359
      INFO 23-04 15:04:43,781 (MCKernelAbstraction.java:install:79) -installing bean: jboss.j2ee:jar=classes,name=BookingListAction,service=EJB3 with dependencies:
      INFO 23-04 15:04:43,812 (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@9daa17{dependency=persistence.units:unitName=booking}
      INFO 23-04 15:04:43,812 (MCKernelAbstraction.java:install:79) -installing bean: jboss.j2ee:jar=classes,name=ChangePasswordAction,service=EJB3 with dependencies:
      INFO 23-04 15:04:43,828 (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@1a3eab6{dependency=persistence.units:unitName=booking}


      It looks to me that the actions all get bound to a JNDI name. I still dont understand why the above error appears.

      All configurations files are configured as stated in Section 7 of the tutorial "Configuring Seam"

      seam.properties
      org.jboss.seam.core.init.jndiPattern #{ejbName}/local
      org.jboss.seam.core.init.componentClasses org.jboss.seam.core.Ejb


      jndi.properties
      java.naming.factory.initial org.jnp.interfaces.LocalOnlyContextFactory
      java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces


      All other files from the embedded-ejb/conf directory are also copied over to my classpath.

      Spent the whole day trying to figure out what is wrong, but all other searches in the forum where unsuccessful.
      Any help is appreciated!

      Thanks in advance!

      Peter