0 Replies Latest reply on Jul 8, 2008 3:39 PM by Filip Rogaczewski

    Could not instantiate Seam component: register

    Filip Rogaczewski Newbie

      Hi,
      I am having some problem with deploying jee5/booking sample from jboss-seam-2.0.2.CR1. I've followed all steps from here: My Link but after all instead of working application I got this error: Could not instantiate Seam component: register.


      Here is the stack trace:




      org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
              at org.jboss.seam.Component.newInstance(Component.java:1970)
              at org.jboss.seam.Component.getInstance(Component.java:1873)
              at org.jboss.seam.Component.getInstance(Component.java:1840)
              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:143)
              at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
              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:173)
              at com.sun.faces.renderkit.htmlbasic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
              at com.sun.faces.renderkit.html
      basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
              at com.sun.faces.renderkit.htmlbasic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
              at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
              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.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:103)
              at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
              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.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:812)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
              at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
              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:106)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1076)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1017)
              at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
              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.RedirectFilter.doFilter(RedirectFilter.java:45)
              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.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.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
              at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
              at com.ibm.ws.webcontainer.filter.WebAppFilterChain.
      doFilter(WebAppFilterChain.java:87)
              at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:773)
              at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:681)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:546)
              at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
              at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3391)
              at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
              at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
              at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
              at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
              at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
              at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
              at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
              at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
              at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
              at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
              at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
              at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
              at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
              at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
              at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
      Caused by: javax.naming.NameNotFoundException: Name comp/env/jboss-seam-jee5 not found in context java:.
              at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
              at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
              at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
              at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
              at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
              at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204)
              at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144)
              at javax.naming.InitialContext.lookup(InitialContext.java:363)
              at org.jboss.seam.Component.instantiateSessionBean(Component.java:1287)
              at org.jboss.seam.Component.instantiate(Component.java:1273)
              at org.jboss.seam.Component.newInstance(Component.java:1966)
              ... 77 more


      I'm running WebSphere Application Server 6.1.0.17 with EJB3.


      My web.xml looks like that:


      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4"
      xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      
        <!-- Seam -->
        
        <listener>        
          <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>    
        </listener>    
      
        <filter>
          <filter-name>Seam Filter</filter-name>
          <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
        </filter>
      
        <filter-mapping>
          <filter-name>Seam Filter</filter-name>
          <url-pattern>/*</url-pattern>
        </filter-mapping>
        
        <servlet>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
        </servlet>
        
        <servlet-mapping>
          <servlet-name>Seam Resource Servlet</servlet-name>
          <url-pattern>/seam/resource/*</url-pattern>
        </servlet-mapping>   
        
        <!-- JSF and Facelets -->
        
        <context-param>        
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>        
          <param-value>.xhtml</param-value>    
        </context-param>
          
        <context-param>        
          <param-name>facelets.DEVELOPMENT</param-name>        
          <param-value>true</param-value>    
        </context-param>    
        
        <!-- Faces Servlet -->
        
        <servlet>        
          <servlet-name>Faces Servlet</servlet-name>        
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>        
          <load-on-startup>1</load-on-startup>    
        </servlet>
        
        <servlet-mapping>        
          <servlet-name>Faces Servlet</servlet-name>        
          <url-pattern>*.seam</url-pattern>    
        </servlet-mapping>
        
       <!-- JEE5 EJB3 names -->
      
        <ejb-local-ref>              
          <ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>                
          <ejb-ref-type>Session</ejb-ref-type>     
          <local-home></local-home>
          <local>org.jboss.seam.example.booking.Authenticator</local>  
        </ejb-local-ref>     
      
        
      
        <ejb-local-ref>       
          <ejb-ref-name>jboss-seam-jee5/BookingListAction</ejb-ref-name>       
          <ejb-ref-type>Session</ejb-ref-type>       
           <local-home></local-home>
          <local>org.jboss.seam.example.booking.BookingList</local>  
        </ejb-local-ref>    
      
        
      
        <ejb-local-ref>       
          <ejb-ref-name>jboss-seam-jee5/RegisterAction</ejb-ref-name>       
          <ejb-ref-type>Session</ejb-ref-type>       
           <local-home></local-home>
          <local>org.jboss.seam.example.booking.Register</local>    
        </ejb-local-ref>    
      
       <ejb-local-ref>       
          <ejb-ref-name>jboss-seam-jee5/ChangePasswordAction</ejb-ref-name>       
          <ejb-ref-type>Session</ejb-ref-type>  
           <local-home></local-home>     
          <local>org.jboss.seam.example.booking.ChangePassword</local>     
        </ejb-local-ref>    
        
        <ejb-local-ref>       
          <ejb-ref-name>jboss-seam-jee5/HotelBookingAction</ejb-ref-name>       
          <ejb-ref-type>Session</ejb-ref-type>       
           <local-home></local-home>
          <local>org.jboss.seam.example.booking.HotelBooking</local>     
        </ejb-local-ref>    
        
        <ejb-local-ref>       
          <ejb-ref-name>jboss-seam-jee5/HotelSearchingAction</ejb-ref-name>       
          <ejb-ref-type>Session</ejb-ref-type>      
           <local-home></local-home> 
          <local>org.jboss.seam.example.booking.HotelSAll of the examples and informaearching</local> 
        </ejb-local-ref>    
      
        <ejb-local-ref>
          <ejb-ref-name>jboss-seam-jee5/EjbSynchronizations</ejb-ref-name>  
          <ejb-ref-type>Session</ejb-ref-type>
          <local-home></local-home>
          <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
        </ejb-local-ref>
        
       <session-config>
          <session-timeout>10</session-timeout> 
        </session-config>   
        
      </web-app>



      persistence.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
                   version="1.0">
         <persistence-unit name="bookingDatabase">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <jta-data-source>DefaultDatasource</jta-data-source>
            <properties>
               <!-- The following two properties are for Glassfish -->
               <property name="hibernate.dialect" 
                    value="org.hibernate.dialect.DerbyDialect"/>
               <property name="hibernate.transaction.manager_lookup_class" 
                  value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
              
                    
               <!-- The following three properties are OC4J -->
               <!-- 
               <property name="hibernate.dialect" 
                         value="org.hibernate.dialect.HSQLDialect"/>
               <property name="hibernate.query.factory_class" 
                  value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
               <property name="hibernate.transaction.manager_lookup_class" 
                  value="org.hibernate.transaction.OrionTransactionManagerLookup"/>
               -->
               
               <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
               <property name="hibernate.show_sql" value="true"/>
              <!--<property name="hibernate.transaction.flush_before_completion" value="true"/>-->
              <property name="hibernate.cache.provider_class" 
                      value="org.hibernate.cache.HashtableCacheProvider"/>
              <property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
              <property name="hibernate.transaction.manager_lookup_class" 
                      value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
                
            </properties>
         </persistence-unit>
      </persistence>



      build.xml


      <?xml version="1.0"?>
      
      <project name="Java EE 5 Booking" default="archive" basedir=".">
      
          <!-- Naming -->
          <property name="Name"                   value="The Java EE 5 Example for Glassfish"/>
          <property name="example.name"           value="jboss-seam-jee5"/>
      
          <!-- resources -->
          <property name="resources.dir" value="resources" />
          <property name="dist.dir" value="dist" />
          <property name="exploded-archives.dir" value="exploded-archives" />
             
          <!-- Libraries to include -->
          <property name="seam.ui.lib"    value="true"/>
          <property name="seam.debug.lib" value="true"/>
          <property name="facelets.lib"   value="true"/>
          <property name="richfaces.lib"   value="true"/>
          <!-- add libs for oc4j (broken classloading) -->
          <!--
          <property name="jbpm.lib" value="true"/>
          <property name="drools.lib" value="true"/>
          <property name="quartz.lib" value="true" />
          <property name="search.lib" value="true" />
          <property name="dbunit.lib" value="true" />
          <property name="jboss-embedded-api.lib" value="true" />
          -->
        
          <import file="../../build.xml"/>
         
              <fileset id="jar.resources" dir="${resources.dir}">
                      <include name="import.sql" />
                      <include name="seam.properties" />
                      <include name="GlassfishDerbyDialect.class" />
                      <include name="META-INF/persistence.xml" />
                      <include name="META-INF/ejb-jar.xml" />
              </fileset>
              
              <fileset id="ear.lib.extras" dir="${seam.dir}">
              <!-- Seam deps -->
                      <include name="lib/javassist.jar"/>
                      <include name="lib/dom4j.jar" />
              
                      <!-- Hibernate and deps -->
                      <include name="lib/hibernate.jar"/>
                      <include name="lib/hibernate-commons-annotations.jar"/>
                      <include name="lib/hibernate-annotations.jar"/>
                      <include name="lib/hibernate-entitymanager.jar"/>
                      <include name="lib/hibernate-validator.jar"/>
                      <include name="lib/jboss-common-core.jar" />
                      <include name="lib/cglib.jar"/>
                      <include name="lib/asm.jar"/>
                      <include name="lib/antlr.jar" />
                      <include name="lib/commons-logging.jar" />
                      <include name="lib/commons-collections.jar" />
                      <!--<include name="lib/log4j.jar" />-->
                      <include name="lib/el-api.jar" />
                      <include name="examples/jpa/lib/el-ri.jar" />
                      <include name="lib/jsf-api.jar" />
                      <include name="lib/jsf-impl.jar" />
                      <include name="lib/jboss-seam.jar" />
                      <include name="examples/jpa/lib/jboss-archive-browsing.jar" />                    
              </fileset>
             
      </project>



      and components.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  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/security http://jboss.com/products/seam/security-2.0.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
      
          <core:init jndi-pattern="java:comp/env/jboss-seam-jee5/#{ejbName}" debug="false"/>
      
          <transaction:ejb-transaction/>
      
          <core:manager conversation-timeout="120000" 
                        concurrent-request-timeout="500"
                        conversation-id-parameter="cid"/>
                        
          <security:identity authenticate-method="#{authenticator.authenticate}"/> 
          <!-- <security:identity authenticate-method="#{test.authenticate}"/> -->
          
      </components>



      Can anybody please help me? Although it doesn't seem to be difficult after day of work I've run out of the ideas how to solve this.