11 Replies Latest reply on Aug 15, 2008 7:20 PM by Samuel Mendenhall

    Problem instantiating a component

    Cedric Decoster Newbie

      Im trying out an example for registration...


      as soon as i want to use it in the register.xhtml for an value or action that
      does use {newMember.memberName} or {registerService.password} it crashes with
      the error message below ...


      i really tryed now for a few hours (about 7) to solve this, but with out result, im still
      new to seam :-) so maybee it's something relly stupid that im missing...


      thanx a lot for any help


      PS: i only posted the actual snippets that i was testing to evaluate where the mistake is...


      14:02:20,563 ERROR [STDERR] 14.08.2008 14:02:20 com.sun.facelets.FaceletViewHandler handleRenderException
      SCHWERWIEGEND: Error Rendering View[/register.xhtml]
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: registerService
           at org.jboss.seam.Component.newInstance(Component.java:1986)
           at org.jboss.seam.Component.getInstance(Component.java:1876)
           at org.jboss.seam.Component.getInstance(Component.java:1843)
           at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1922)
           at org.jboss.seam.Component.getInstance(Component.java:1866)
           at org.jboss.seam.Component.getInstance(Component.java:1843)
           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:166)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
           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 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:108)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
           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.MultipartFilter.doFilter(MultipartFilter.java:85)
           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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           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(Unknown Source)
      Caused by: javax.naming.NameNotFoundException: RegisterService 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(Unknown Source)
           at org.jboss.seam.Component.instantiateSessionBean(Component.java:1290)
           at org.jboss.seam.Component.instantiate(Component.java:1276)
           at org.jboss.seam.Component.newInstance(Component.java:1970)
           ... 74 more
      






      RegisterService.java


      @Stateful
      @Name("registerService")
      public class RegisterService implements Register {
      
           @In(required = false)
           @Out
           private Member newMember;
      
           @In(create = true, value = "entityManager")
           private EntityManager em;
      
           private String password;
      
           @Destroy
           @Remove
           public void destroy() {
           }
      
           @Factory("newMember")
           @Begin
           public void start() {
                newMember = new Member();
           }
      }
      



      register.xhtml


      ...
      ...
      ...
                               <h:inputText
                                    styleClass="input-field" id="membername"
                                    value="#{newMember.memberName}" size="40" maxlength="40"
                                    required="true" />
      ...
      ...
      ...
                          <div><h:outputLabel for="password" value="Password" /> <h:inputSecret
                               styleClass="input-field" id="password" value="#{registerService.password}"
                               size="40" maxlength="40" required="true" /> <h:message
                               styleClass="error" for="password" /></div>
      ...
      ...
      ...
      



        • 1. Re: Problem instantiating a component
          blabno Master

          Show your components.xml. I guess there is a problem (jndiPattern). Also check log if whole deployment was successful.

          • 2. Re: Problem instantiating a component
            Samuel Mendenhall Apprentice

            Make sure your Register interface has a @Local on it.

            • 3. Re: Problem instantiating a component
              Cedric Decoster Newbie
              <?xml version="1.0" encoding="UTF-8"?>
              <components xmlns="http://jboss.com/products/seam/components"
                          xmlns:core="http://jboss.com/products/seam/core"
                          xmlns:persistence="http://jboss.com/products/seam/persistence"
                          xmlns:drools="http://jboss.com/products/seam/drools"
                          xmlns:bpm="http://jboss.com/products/seam/bpm"
                          xmlns:security="http://jboss.com/products/seam/security"
                          xmlns:mail="http://jboss.com/products/seam/mail"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xsi:schemaLocation=
                              "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd 
                               http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd 
                               http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
                               http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
                               http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                               http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
                               http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
              
                 <core:init debug="true" jndi-pattern="@jndiPattern@"/>
                   
                 <core:manager concurrent-request-timeout="500" 
                               conversation-timeout="120000" 
                               conversation-id-parameter="cid"
                               parent-conversation-id-parameter="pid"/>
                  
                 <persistence:managed-persistence-context name="entityManager"
                                                   auto-create="true"
                                        entity-manager-factory="#{mo2pthotEntityManagerFactory}"/>
              
                 <persistence:entity-manager-factory name="mo2pthotEntityManagerFactory" 
                                    persistence-unit-name="mo2pthot"/>
                 
                 <drools:rule-base name="securityRules">
                     <drools:rule-files><value>/security.drl</value></drools:rule-files>
                 </drools:rule-base>
              
                 <security:identity authenticate-method="#{authenticator.authenticate}"
                                         security-rules="#{securityRules}"
                                            remember-me="true"/>
                                            
                 <event type="org.jboss.seam.security.notLoggedIn">
                     <action execute="#{redirect.captureCurrentView}"/>
                 </event>
                 <event type="org.jboss.seam.security.loginSuccessful">
                     <action execute="#{redirect.returnToCapturedView}"/>
                 </event>
                 
                 <mail:mail-session host="localhost" port="2525" username="test" password="test" />
                      
                 <!-- For use with jBPM pageflow or process management -->
                 <!--  
                 <bpm:jbpm>
                    <bpm:process-definitions></bpm:process-definitions>
                    <bpm:pageflow-definitions></bpm:pageflow-definitions>
                 </bpm:jbpm>
                 -->
                    
              </components>
              


              • 4. Re: Problem instantiating a component
                Cedric Decoster Newbie
                //import org.jboss.annotation.ejb.Local;
                import javax.ejb.Local;
                
                @Local
                public interface Register {
                     
                }
                



                thanx i just added it but the problem still is the same it
                crashes with


                14:54:38,063 ERROR [STDERR] 14.08.2008 14:54:38 com.sun.facelets.FaceletViewHandler handleRenderException
                SCHWERWIEGEND: Error Rendering View[/register.xhtml]
                org.jboss.seam.InstantiationException: Could not instantiate Seam component: registerService
                


                • 5. Re: Problem instantiating a component
                  Cedric Decoster Newbie

                  i think the deployment was successful, i can check the page...and just in the case i hit register.seam it crashes...

                  • 6. Re: Problem instantiating a component
                    Samuel Mendenhall Apprentice

                    There is probably a nested exception that tells the cause.  So there are further problems I see.  You need a:



                    @Remove @Destroy
                    public void destroy() {}


                      in your Register Action and:



                    @Local
                    public interface Register {
                      public void destroy();
                    }




                    And you will need to define any methods used in your RegisterAction in your Register interface like:



                    @Local
                    public interface Register {
                      public void destroy();
                      public void register();
                    }




                    If you still have problems after doing this post the full stacktrace.

                    • 7. Re: Problem instantiating a component
                      Cedric Decoster Newbie

                      thanx for the help, i really have no clue what i do miss...
                      i repost the interface Register and the RegisterService...
                      it's still crashing with the instantiate problem...


                      full stack trace


                      org.jboss.seam.InstantiationException: Could not instantiate Seam component: registerService
                           at org.jboss.seam.Component.newInstance(Component.java:1986)
                           at org.jboss.seam.Component.getInstance(Component.java:1876)
                           at org.jboss.seam.Component.getInstance(Component.java:1843)
                           at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1922)
                           at org.jboss.seam.Component.getInstance(Component.java:1866)
                           at org.jboss.seam.Component.getInstance(Component.java:1843)
                           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:166)
                           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
                           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 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:108)
                           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                           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.MultipartFilter.doFilter(MultipartFilter.java:85)
                           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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                           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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                           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(Unknown Source)
                      Caused by: javax.naming.NameNotFoundException: RegisterService 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(Unknown Source)
                           at org.jboss.seam.Component.instantiateSessionBean(Component.java:1290)
                           at org.jboss.seam.Component.instantiate(Component.java:1276)
                           at org.jboss.seam.Component.newInstance(Component.java:1970)
                           ... 74 more
                      
                      




                      Register.java


                      import org.jboss.annotation.ejb.Local;
                      
                      @Local
                      public interface Register {
                           public void destroy();
                           public void start();
                      }
                      



                      RegisterService.java


                      import java.util.Date;
                      import java.util.HashSet;
                      import org.domain.mo2pthot.entity.Member;
                      import org.domain.mo2pthot.entity.MemberRole;
                      import javax.ejb.Remove;
                      import javax.ejb.Stateful;
                      import javax.persistence.EntityManager;
                      import javax.persistence.NoResultException;
                      import javax.persistence.PersistenceContext;
                      import javax.persistence.PersistenceContextType;
                      import javax.security.auth.login.LoginException;
                      import org.apache.commons.codec.digest.DigestUtils;
                      import org.jboss.seam.faces.FacesMessages;
                      import org.jboss.seam.faces.Renderer;
                      import org.jboss.seam.annotations.*;
                      
                      @Stateful
                      @Name("registerService")
                      public class RegisterService implements Register {
                      
                           @In(required = false)
                           @Out
                           private Member newMember;
                      
                           @In(create = true, value = "entityManager")
                           private EntityManager em;
                      
                           /**
                            * Password confirmation
                            */
                      
                           private String password;
                      //     private String confirm;
                      //
                      //     private boolean verified;
                      
                           @Destroy
                           @Remove
                           public void destroy() {
                           }
                      
                      //     public void verify() {
                      //          boolean validPass = validPassword();
                      //          boolean uniqueName = uniqueName();
                      //          boolean uniqueEmail = uniqueEmail();
                      //          verified = validPass && uniqueName && uniqueEmail;
                      //     }
                      //
                      //     private boolean validPassword() {
                      //          if (password != null && confirm != null && password.equals(confirm)) {
                      //               newMember.setPasswordHash(DigestUtils.shaHex(password));
                      //               return true;
                      //          }
                      //          FacesMessages.instance().add("Passwords do not match");
                      //          return false;
                      //     }
                      //
                      //     private boolean uniqueName() {
                      //          try {
                      //               em.createQuery("from gs_member m where m.memberName = :name")
                      //                         .setParameter("name", newMember.getMemberName())
                      //                         .getSingleResult();
                      //          } catch (NoResultException e) {
                      //               return true;
                      //          }
                      //          FacesMessages.instance().add(
                      //                    "The display name you specified "
                      //                              + "is already taken. Please select another one");
                      //          return false;
                      //     }
                      //
                      //     private boolean uniqueEmail() {
                      //          try {
                      //               em.createQuery("from gs_member m where m.email = :email")
                      //                         .setParameter("email", newMember.getEmail())
                      //                         .getSingleResult();
                      //          } catch (NoResultException e) {
                      //               return true;
                      //          }
                      //          FacesMessages.instance().add(
                      //                    "The email address you "
                      //                              + "specified is already registered in the system.");
                      //          return false;
                      //     }
                      
                           @Factory("newMember")
                           @Begin
                           public void start() {
                                newMember = new Member();
                           }
                      }
                      



                      and the register.xhtml


                      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                           xmlns:s="http://jboss.com/products/seam/taglib"
                           xmlns:ui="http://java.sun.com/jsf/facelets"
                           xmlns:f="http://java.sun.com/jsf/core"
                           xmlns:h="http://java.sun.com/jsf/html"
                           xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
                      
                           <ui:define name="title">Registration</ui:define>
                      
                           <ui:define name="body">
                                <h1>Become a member</h1>
                                <p>Fill out the form below to become a member and start enjoying
                                the artworks</p>
                                <div id="form-area"><h:form id="registration-form">
                                     <span class="error"><h:messages globalOnly="true" /></span>
                                     <s:validateAll>
                                          <fieldset><legend>Enter your contact details</legend>
                      
                                          <p>
                                               <h:outputLabel for="membername" value="Display name" />
                                               <h:inputText
                                                    styleClass="input-field" id="membername"
                                                    value="#{newMember.memberName}" size="40" maxlength="40"
                                                    required="true" />
                                               <h:message styleClass="error" for="membername" />
                                          </p>
                                          
                      <!--                    <p><h:outputLabel for="email" value="Email address" /> <h:inputText-->
                      <!--                         styleClass="input-field" id="email" value="#{newMember.email}"-->
                      <!--                         size="40" maxlength="40" required="true" /> <h:message-->
                      <!--                         styleClass="error" for="email" /></p>-->
                      
                                          </fieldset>
                                          <fieldset><legend>Choose a password</legend>
                      
                      <!--                    <div><h:outputLabel for="password" value="Password" /> <h:inputSecret-->
                      <!--                         styleClass="input-field" id="password" value="#{registerService.password}"-->
                      <!--                         size="40" maxlength="40" required="true" /> <h:message-->
                      <!--                         styleClass="error" for="password" /></div>-->
                      <!--                    <div><h:outputLabel for="confirm" value="Confirm password" />-->
                      <!--                    <h:inputSecret styleClass="input-field" id="confirm"-->
                      <!--                         value="#{registerService.confirm}" size="40" maxlength="40"-->
                      <!--                         required="true" /> <h:message styleClass="error" for="confirm" />-->
                      <!--                    </div>-->
                      
                                          </fieldset>
                      
                      <!--                    <div class="submit-buttons"><h:commandButton value="Next"-->
                      <!--                         action="#{registerService.verify}" id="registerButton" /></div>-->
                      
                                     </s:validateAll>
                                </h:form></div>
                           </ui:define>
                      </ui:composition>
                      




                      • 8. Re: Problem instantiating a component
                        Samuel Mendenhall Apprentice

                        Unless I am missing some simple syntax mistake, it is probably one of a few issues:



                        • RegisterAction/Register placed in the wrong location

                        • Messed up classpath/config

                        • Wrong jndiPattern (probably not though if this is a default seam-gen)



                        So, what I'd like you to do is this, backup and remove your existing RegisterAction/Register classes, go to your SEAM_HOME dir where you created project from, and do './seam new-action' and answer the questions, this will ensure that the files are generated to the right locations.  Test out what it generates, make sure it all works, then you can begin adding your custom code.


                        If that fails, that means something is fubar in your project, create a new project (seam setup and seam new-project) and new-action like above, it will work.

                        • 9. Re: Problem instantiating a component
                          Cory Dahlstrom Novice

                          This looks like a possible jndi-pattern problem as stated before.  In order for you to get your components.xml working like you have it, components.properties must be in the classpath of your EAR and have properties like:


                          jndiPattern yourApp/#{ejbName}/local


                          Cory.

                          • 10. Re: Problem instantiating a component
                            Cedric Decoster Newbie

                            i did what u told me and regenerated all, rewrote it and used most of the booking example, still get the bound problem...


                            but maybee its not a code problem ...


                            im using JBoss Tools nightly build to generate seam-gen stuff and i use war not ear...
                            maybee this is the main problem im trying now to genereate it outside with seam-gen apart from jboss tools...


                            i will write later if i was successful

                            • 11. Re: Problem instantiating a component
                              Samuel Mendenhall Apprentice

                              Mystery solved, WARs don't support EJB3s, you'll get the message you are seeing.  Regen your project and select EAR and it will work, of course, then, you can't deploy, but why do you need EJB3s to begin with?  it definitely isn't necessary for your registration bean.  Unless you need the additional functionality of EJB3s, you'd do better with a WAR project.