7 Replies Latest reply on Feb 9, 2009 8:01 AM by rama y

    Could not instantiate Seam component: register with Maven2 seam registration example

    rama y Newbie
      When trying to run seam registration example that has been built using Maven on JBoss 4.2.x facing the following error message after clicking the 'register' button
      
      -------------------------------------------------------------------------------------
      javax.servlet.ServletException: Could not instantiate Seam component: register
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
              org.jboss.seam.Component.newInstance(Component.java:2106)
              org.jboss.seam.Component.getInstance(Component.java:1988)
              org.jboss.seam.Component.getInstance(Component.java:1950)
              org.jboss.seam.Component.getInstance(Component.java:1944)
              org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
              org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
              org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
              org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
              javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
              com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
              org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
              org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
              org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
              org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
              com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
              javax.faces.component.UICommand.broadcast(UICommand.java:383)
              javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
              javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
              com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
              com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
              com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      
      root cause
      
      javax.naming.NameNotFoundException: RegisterAction not bound
              org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
              org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
              org.jnp.server.NamingServer.getObject(NamingServer.java:543)
              org.jnp.server.NamingServer.lookup(NamingServer.java:267)
              org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
              org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
              javax.naming.InitialContext.lookup(InitialContext.java:392)
              org.jboss.seam.Component.instantiateSessionBean(Component.java:1367)
              org.jboss.seam.Component.instantiate(Component.java:1331)
              org.jboss.seam.Component.newInstance(Component.java:2084)
              org.jboss.seam.Component.getInstance(Component.java:1988)
              org.jboss.seam.Component.getInstance(Component.java:1950)
              org.jboss.seam.Component.getInstance(Component.java:1944)
              org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
              org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
              org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
              org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
              javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
              com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
              org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
              org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
              org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
              org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
              com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
              javax.faces.component.UICommand.broadcast(UICommand.java:383)
              javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
              javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
              com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
              com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
              com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
              org|.jboss|.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      -------------------------------------------------------------------------------------
      
      Please find below the pom.xml that is being used
      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <project>
              <modelVersion>4.0.0</modelVersion>
              <groupId>seamregn</groupId>
              <artifactId>seamregn</artifactId>
              <packaging>war</packaging>
              <version>1.0</version>
      
              <repositories>
                      <repository>
                      <id>jboss-seam</id>
                      <url>http://repository.jboss.org/maven2</url>
                      </repository>
              </repositories>
      
      
              <build>
                      <plugins>
                                <plugin>
                                      <artifactId>maven-compiler-plugin</artifactId>
                                      <inherited>true</inherited>
                                      <configuration>
                                              <source>1.6</source>
                                              <target>1.6</target>
                                      </configuration>
                              </plugin>
      
                              <plugin>
                                       <groupId>org.apache.maven.plugins</groupId>
                                      <artifactId>maven-war-plugin</artifactId>
                               <configuration>
                              <modules>
                                      <webModule>
                                      <groupId>${project.groupId}</groupId>
                                      <artifactId>seamregn</artifactId>
                                      <contextRoot>/seamregn</contextRoot>
                                      </webModule>
                               </modules>
                               <jboss>
                                      <version>4</version>
                                      <unauthenticated-principal>guest</unauthenticated-principal>
                               </jboss>
      
                              </configuration>
      
                              </plugin>
                      </plugins>
              </build>
              
              <prerequisites>
                      <maven>2.0.9</maven>
              </prerequisites>
      
              <properties>
                      <seam.version>2.1.1.GA</seam.version>
              </properties>
      
              <dependencies>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam</artifactId>
                              <version>${seam.version}</version>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javax.servlet</groupId>
                                              <artifactId>servlet-api</artifactId>
                                      </exclusion>
                                      <exclusion>
                                              <groupId>jboss</groupId>
                                              <artifactId>javassist</artifactId>
                                      </exclusion>
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-ui</artifactId>
                              <version>${seam.version}</version>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javax.servlet</groupId>
                                              <artifactId>servlet-api</artifactId>
                                      </exclusion>
                                      <exclusion>
                                              <groupId>javax.el</groupId>
                                              <artifactId>el-api</artifactId>
                                      </exclusion>                              
      
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.el</groupId>
                              <artifactId>jboss-el</artifactId>
                              <version>unknown</version>
                              <scope>system</scope>
          <systemPath>/home/iw/lib/jboss-el.jar</systemPath> 
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-ioc</artifactId>
                              <version>${seam.version}</version>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javax.servlet</groupId>
                                              <artifactId>servlet-api</artifactId>
                                      </exclusion>
                                      <exclusion>
                                              <groupId>javax.el</groupId>
                                              <artifactId>el-api</artifactId>
                                      </exclusion>                                      
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-debug</artifactId>
                              <version>${seam.version}</version>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javax.servlet</groupId>
                                              <artifactId>servlet-api</artifactId>
                                      </exclusion>
                                      <exclusion>
                                              <groupId>javax.el</groupId>
                                              <artifactId>el-api</artifactId>
                                      </exclusion>                                      
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.hibernate</groupId>
                              <artifactId>hibernate-validator</artifactId>
                              <version>3.1.0.GA</version>
                              <scope>provided</scope>
                      </dependency>
                      <dependency>
                              <groupId>javax.persistence</groupId>
                              <artifactId>persistence-api</artifactId>
                              <scope>provided</scope>
                              <version>1.0</version>
                      </dependency>
                      <dependency>
                              <groupId>javax.servlet</groupId>
                              <artifactId>servlet-api</artifactId>
                              <version>2.5</version>
                              <scope>provided</scope>
                      </dependency>
                      <dependency>
                              <groupId>postgresql</groupId>
                              <artifactId>postgresql</artifactId>
                              <version>8.3-603.jdbc4</version>
                              <scope>provided</scope>
                      </dependency>
                      <dependency>
                              <groupId>javax.ejb</groupId>
                              <artifactId>ejb-api</artifactId>
                              <version>3.0</version>
                              <scope>provided</scope>
                      </dependency>     
                      <dependency>
                              <groupId>org.apache.myfaces.core</groupId>
                              <artifactId>myfaces-api</artifactId>
                              <version>1.2.5</version>
                              <scope>provided</scope>
                      </dependency>
                      <dependency>
                              <groupId>org.apache.myfaces.core</groupId>
                              <artifactId>myfaces-impl</artifactId>
                              <version>1.2.5</version>
                              <scope>provided</scope>
                      </dependency>
      
                      
                      <!-- ####################################################### -->
                      <!-- Test Scoped dependencies                                                                 -->
                      <!-- Runs integration tests using SeamTest and JBoss          -->
                      <!-- Embedded framework                                                                               -->
                      <!-- ####################################################### -->  
                      <dependency>
                          <groupId>org.testng</groupId>
                          <artifactId>testng</artifactId>
                          <version>5.8</version>
                          <scope>test</scope>
                           <classifier>jdk15</classifier>
                      </dependency>
                      <dependency>
                              <groupId>org.eclipse.jdt</groupId>
                              <artifactId>core</artifactId>
                              <version>3.2.0.658</version>
                              <scope>test</scope>
                      </dependency> 
                      <dependency>
                              <groupId>org.jboss.embedded</groupId>
                              <artifactId>hibernate-all</artifactId>
                              <version>beta3.SP3</version>
                              <scope>test</scope>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.embedded</groupId>
                              <artifactId>jboss-embedded-all</artifactId>
                              <version>beta3.SP3</version>
                              <scope>test</scope>
                      </dependency>             
                      <dependency>
                              <groupId>org.jboss.embedded</groupId>
                              <artifactId>jboss-embedded-api</artifactId>
                              <version>beta2</version>
                              <scope>test</scope>
                      </dependency>                     
                      <dependency>
                              <groupId>org.jboss.embedded</groupId>
                              <artifactId>thirdparty-all</artifactId>
                              <version>beta3.SP2</version>
                              <scope>test</scope>
                      </dependency>             
                      <dependency>
                      <groupId>javax.activation</groupId>
                      <artifactId>activation</artifactId>
                      <version>1.1</version>
                      <scope>test</scope>
                      </dependency> 
              </dependencies>                   
      </project>
      
      
      We have also added JBoss-el.jar and hibernate-core-3.3.0.jar to WEB-INF/lib to resolve other errors.
      
      Any help is appreciated.