1 Reply Latest reply on Apr 22, 2008 12:07 PM by Balvindar Dhaliwal

    Seam, RichFaces and Trinidad

    Balvindar Dhaliwal Newbie

      Hi,

      I am trying to get seam 2.0.2, richfaces working with trinidad 1.2.7.

      I have followed the instructions on:

      http://wiki.apache.org/myfaces/TrinidadSeamAjax4JsfFaceletDetail


      I can run the the jee5/booking example with richfaces on weblogic.

      When I try to integrate trinidad 1.2.7,

      build.xml
      ---------

      
      ...
      <!-- 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="war.lib.extras" dir="${seam.dir}">
      
      
       <include name="lib/jsf-impl.jar"/>
       <include name="lib/richfaces-api.jar"/>
       <include name="examples/jee5/lib/trinidad-api-1.2.7.jar"/>
       <include name="examples/jee5/lib/trinidad-impl-1.2.7.jar"/>
      
       <include name="examples/jee5/lib/a4j-trinidad.jar"/>
      
      
       </fileset>
      
       <fileset id="ear.lib.extras" dir="${seam.dir}">
       <!-- Seam deps -->
       <include name="lib/javassist.jar"/>
       <include name="lib/dom4j.jar" />
      
       <!-- Move jsf here because of WL 10 MP1 classloader issue -->
      
       <include name="lib/jsf-api.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="examples/jee5/lib/concurrent.jar"/>
      
      
      
      ...
      
      



      web.xml
      -------

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5"
       xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
      
      
      
       <!-- JSF and Facelets -->
      
       <context-param>
       <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      
       </context-param>
      
       <!-- Use client-side state saving. In Trinidad, it is an
       optimized, token-based mechanism that is almost always a
       better choice than the standard JSF server-side state saving. -->
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       <!--param-value>server</param-value-->
       </context-param>
      
       <context-param>
       <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
       <param-value>false</param-value>
       </context-param>
      
       <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>
      
       <!-- ************************ AJAX4JSF Filter **************************** -->
       <!-- If you have other filters declared in the web.xml, be sure that Ajax4jsf Filter is declared before the others. -->
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       <init-param>
       <param-name>forceparser</param-name>
       <param-value>false</param-value>
       </init-param>
       </filter>
      
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>
      
       <!-- ************************ Trinidad Filter **************************** -->
       <filter>
       <filter-name>Trinidad</filter-name>
       <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>Trinidad</filter-name>
       <!--<servlet-name>Faces Servlet</servlet-name>-->
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>
      
      
      
       <!-- SEAM Filter -->
       <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>
      
      
       <!-- ************************ Trinidad resources servlet **************************** -->
       <servlet>
       <servlet-name>Trinidad Resources</servlet-name>
       <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
       </servlet>
      
       <!-- This cannot be configured currently -->
       <servlet-mapping>
       <servlet-name>Trinidad Resources</servlet-name>
       <url-pattern>/adf/*</url-pattern>
       </servlet-mapping>
      
       <!-- SEAM Servlet -->
      
       <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>
      
      
       <!-- 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>
      
      
       <!-- Seam -->
      
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
      
      
      ...
      
      


      With seam, richfaces and trinidad, I get the following error:

      java.lang.IllegalStateException: No RenderingContext
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeBegin(CoreRenderer.java:194)
      at org.apache.myfaces.trinidadinternal.renderkit.htmlBasic.HtmlFormRenderer.encodeBegin(HtmlFormRenderer.java:56)
      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
      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 weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      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.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.BaseFilter.doFilter(BaseFilter.java:307)
      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.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:238)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:195)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3393)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Unknown Source)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

      Please advise. Any help appreciated.

      Thanks,
      Balvindar