4 Replies Latest reply on Jun 8, 2010 9:46 AM by Sean Tozer

    RegisterAction not Bound

    Olalekan Ogunleye Newbie
      Hi All,

      I am using the NestedBooking example as a guide and after I made some changes I got RegisterAction  not bount error. Below is my error log as I don't know what I am doing wrong. Can someone please help in this regard. Thank you


      15:13:57,276 ERROR [viewhandler] Error Rendering View[/register.xhtml]
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
           at org.jboss.seam.Component.newInstance(Component.java:2156)
           at org.jboss.seam.Component.getInstance(Component.java:2021)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
           at org.jboss.seam.ui.renderkit.ValidateAllRendererBase.doEncodeChildren(ValidateAllRendererBase.java:33)
           at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:186)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
           at org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:152)
           at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234)
           at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:178)
           at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:126)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
           at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:619)
      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:667)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
           at javax.naming.InitialContext.lookup(InitialContext.java:392)
           at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
           at org.jboss.seam.Component.instantiate(Component.java:1364)
           at org.jboss.seam.Component.newInstance(Component.java:2134)
           ... 83 more
        • 1. Re: RegisterAction not Bound
          Sean Tozer Newbie

          Please post your register.xhtml file and whatever component is annotated @name(register).

          • 2. Re: RegisterAction not Bound
            Olalekan Ogunleye Newbie
            Thank you sean. This is my register.xhtml


            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:s="http://jboss.com/products/seam/taglib">
            <head>
                 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                 <title>Samuel: Register</title>
                 <link href="css/screen.css" rel="stylesheet" type="text/css" />
            </head>
            <body id="pgHome">

              <ui:composition template="template.xhtml">
                <ui:define name="content">
                 
                  <div id="section">
                 <center><h:form id="register">
                  <h:panelGrid width="50" columns="2" size="100%" border="1" align="center" bgcolor="#e6edfd" layout="block">
                  <f:facet name="header">
                        <h:outputText value="Mobi4D Register"/>
                     </f:facet>
                  <s:decorate template="edit.xhtml" id="firstnameDecorate">
                  <ui:define name="label">First Name:</ui:define>
                  <h:inputText id="firstname" value="#{user.fname}" size="40" required="true">
                  </h:inputText>
                  </s:decorate>
                  <s:decorate template="edit.xhtml" id="address1Decorate">
                                         <ui:define name="label">Address1:</ui:define>
                                          <h:inputText id="address1" value="#{user.address1}" size="40" required="true">
                                    </h:inputText>
                                     </s:decorate>     
                                     
                                      <s:decorate template="edit.xhtml" id="surnameDecorate">
                                         <ui:define name="label">Surname:</ui:define>
                                          <h:inputText id="surname" value="#{user.surname}" size="40" required="true">
                                    </h:inputText>
                                     </s:decorate>     
                                     
                                     <s:decorate template="edit.xhtml" id="address2Decorate">
                                         <ui:define name="label">Address2:</ui:define>
                                          <h:inputText id="address2" value="#{user.address2}" size="40" required="false">
                                    </h:inputText>
                                     </s:decorate>     
                                     <s:decorate template="edit.xhtml" id="organisationDecorate">
                                         <ui:define name="label">Organisation:</ui:define>
                                          <h:inputText id="organisation" value="#{user.organisation}" size="40" required="false">
                                    </h:inputText>
                                     </s:decorate>
                                     
                                     <s:decorate template="edit.xhtml" id="cityDecorate">
                                         <ui:define name="label">City:</ui:define>
                                          <h:inputText id="city" value="#{user.city}" size="40" required="false">
                                    </h:inputText>
                                     </s:decorate>
                                     
                                     <s:decorate template="edit.xhtml" id="emailDecorate">
                                         <ui:define name="label">Email Address:</ui:define>
                                          <h:inputText id="email" value="#{user.email}" size="40" required="false">
                                    </h:inputText>
                                     </s:decorate>
                                     
                                     <s:decorate template="edit.xhtml" id="verifyemailDecorate">
                                         <ui:define name="label">Verify Email:</ui:define>
                                          <h:inputText id="verify" value="#{register.verifyEmail}" size ="40" required="true"/>
                                     </s:decorate>
                                     
                                     <s:decorate template="edit.xhtml" id="postalcodeDecorate">
                                         <ui:define name="label">Postal Code:</ui:define>
                                          <h:inputText id="email" value="#{user.postalCode}" size="40" required="false">
                                    </h:inputText>
                                     </s:decorate>
                                     
                                     <s:decorate template="edit.xhtml" id="mobilenumberDecorate">
                                         <ui:define name="label">Mobile Number:</ui:define>
                                          <h:inputText id="mobilenumber" value="#{user.mobilenumber}" size="40" required="false">
                                    </h:inputText>
                                     </s:decorate>
                                     
                                     <s:decorate template="/edit.xhtml" id="usertypeDecorate">
                                          <ui:define name="label">Type of User:</ui:define>
                                          <h:selectOneListbox id="usertype" value="#{user.usertype}" required="true">
                                          </h:selectOneListbox>
                                    </s:decorate>     
                                   
                                                  
                  </h:panelGrid>
                  <div class="entry">
                                          <div class="label">&#160;</div>
                                          <div class="input">
                                               <h:commandButton id="register" value="Register" action="#{register.register}"/>&#160;
                                               <s:button id="cancel" value="Cancel" view="/home.xhtml"/>
                                          </div>
                                     </div>
                  </h:form></center>
                  </div>
                </ui:define>
               
              </ui:composition>
              </body>
            </html>


            Also below is my RegisterAction.java which is a component that is annotated@name("register")




            package za.co.cses.samuel.session;
            import static org.jboss.seam.ScopeType.EVENT;
            import java.util.List;
            import javax.ejb.Remove;
            import javax.ejb.Stateful;
            import javax.persistence.EntityManager;
            import javax.persistence.PersistenceContext;
            import org.jboss.seam.annotations.Destroy;
            import org.jboss.seam.annotations.In;
            import org.jboss.seam.annotations.Name;
            import org.jboss.seam.annotations.Scope;
            import org.jboss.seam.faces.FacesMessages;
            @Stateful
            @Scope(EVENT)
            @Name("register")
            public class RegisterAction implements Register
            {
               @In
               private User user;
              
               @PersistenceContext
               private EntityManager entitymanager;
              
               @In
               private FacesMessages facesMessages;
              
               private String verifyEmail;
              
               private boolean registered;
              
               @SuppressWarnings("unchecked")
            public void register()
               {
                  if ( user.getEmail().equals(verifyEmail) )
                  {
                     List existing = entitymanager.createQuery("select u.email from User u where u.email=#{user.email}")
                        .getResultList();
                     if (existing.size()==0)
                     {
                          entitymanager.persist(user);
                        facesMessages.add("You have Successfully registered as #{user.email}. Please, note that your password will be emailed to you shortly");
                        registered = true;
                     }
                     else
                     {
                        facesMessages.addToControl("username", "Username #{user.email} already exists");
                     }
                  }
                  else
                  {
                     facesMessages.addToControl("Email verification ", "Re-enter your email address");
                     verifyEmail=null;
                  }
               }
              
               public void invalid()
               {
                  facesMessages.add("Please try again");
               }
              
               public boolean isRegistered()
               {
                  return registered;
               }
               //public String getVerify()
               //{
                //  return verify;
               //}
              // public void setVerify(String verify)
              // {
              //    this.verify = verify;
              // }
              
              

            public String getVerifyEmail() {
                 return verifyEmail;
            }

            public void setVerifyEmail(String verifyEmail) {
                 this.verifyEmail = verifyEmail;
                 
                 
            }
            @Destroy @Remove
            public void destroy() {}

            }
            • 3. Re: RegisterAction not Bound
              Olalekan Ogunleye Newbie

              Can someone please help me to solve this problem. I have tried my best and I have looked at my codes over and over again but seam to find nothing wrong with it and I dont know what is it that I am doing wrong. Please I need help as soon as possible. Thanks in advance

              • 4. Re: RegisterAction not Bound
                Sean Tozer Newbie

                I don't see anything wrong in the code posted, at first glance. NameNotFound might indicate that you're having a deployment problem of some kind. Did you change anything in any of the component.xml or other .xml files from the example?