Announcement Announcement Module
Collapse
No announcement yet.
Webflow + myfaces + richfaces Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webflow + myfaces + richfaces

    Hi,
    I'm trying to use spring webflow with myfaces and richfaces. I'm using tomEE 1.6.0 (it contain myfaces 2.1.13).
    I've try differents configurations, but none works :/

    My actual configuration is : webflow 2.4.0.RC1 with richfaces 4.3.6.Final.

    With this solution, i can display a page, but can't navigate!
    When i try to navigate i have this exception :
    Code:
    java.lang.NoClassDefFoundError: org/apache/myfaces/renderkit/StateCacheUtils
        at org.springframework.faces.webflow.MyFacesFlowResponseStateManager.getWrappedMyfacesResponseStateManager(MyFacesFlowResponseStateManager.java:66)
        at org.springframework.faces.webflow.MyFacesFlowResponseStateManager.isWriteStateAfterRenderViewRequired(MyFacesFlowResponseStateManager.java:70)
        at org.apache.myfaces.application.ViewHandlerImpl.setWritingState(ViewHandlerImpl.java:399)
        at org.apache.myfaces.application.ViewHandlerImpl.writeState(ViewHandlerImpl.java:343)
        at javax.faces.application.ViewHandlerWrapper.writeState(ViewHandlerWrapper.java:65)
        at javax.faces.application.ViewHandlerWrapper.writeState(ViewHandlerWrapper.java:65)
        at javax.faces.application.ViewHandlerWrapper.writeState(ViewHandlerWrapper.java:65)
        at org.apache.myfaces.shared.renderkit.html.HtmlFormRendererBase.encodeEnd(HtmlFormRendererBase.java:220)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:665)
        at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:545)
        at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
        at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
        at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1981)
        at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:305)
        at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
        at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
        at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
        at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
        at org.springframework.faces.support.LifecycleWrapper.render(LifecycleWrapper.java:54)
        at org.springframework.faces.webflow.JsfView.render(JsfView.java:87)
        at org.springframework.webflow.engine.ViewState.render(ViewState.java:293)
        at org.springframework.webflow.engine.ViewState.refresh(ViewState.java:242)
        at org.springframework.webflow.engine.ViewState.resume(ViewState.java:220)
        at org.springframework.webflow.engine.Flow.resume(Flow.java:537)
        at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
        at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
        at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:228)
        at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:57)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
    ...
    i only found an issue which look the same on stackoverflow : http://stackoverflow.com/questions/1...xception-issue

    my web.xml is :
    Code:
        <context-param>
            <description>Project stage for the application (new in 2.0). Expects one of
          the following values: Development, Production, SystemTest, UnitTest
        </description>
            <param-name>javax.faces.PROJECT_STAGE</param-name>
            <param-value>Development</param-value>
        </context-param>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/beans.xml</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>server</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
            <param-value>false</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
            <param-value>*.xhtml</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
            <param-value>.xhtml</param-value>
            <!-- <param-value>.vie</param-value> -->
        </context-param>
        <context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>facelets.REFRESH_PERIOD</param-name>
            <param-value>1</param-value>
        </context-param>
    
        <filter>
            <filter-name>charEncodingFilter</filter-name>
            <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
            <init-param>
                <param-name>encoding</param-name>
                <param-value>UTF-8</param-value>
            </init-param>
            <init-param>
                <param-name>forceEncoding</param-name>
                <param-value>true</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>charEncodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    
        <!-- SPRING -->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <servlet>
            <servlet-name>Resources Servlet</servlet-name>
            <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
            <load-on-startup>0</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>Resources Servlet</servlet-name>
            <url-pattern>/resources/*</url-pattern>
        </servlet-mapping>
        <servlet>
            <servlet-name>Spring Dispatcher Servlet</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/spring/servlet-context.xml</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>Spring Dispatcher Servlet</servlet-name>
            <url-pattern>/app/*</url-pattern>
        </servlet-mapping>
    
        <!-- Faces Servlet -->
        <servlet>
            <servlet-name>facesServlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.vie</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.xhtml</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.faces</url-pattern>
        </servlet-mapping>
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
        </welcome-file-list>
    </web-app>
    my spring config (servlet-context.xml)
    Code:
          
        <import resource="webflow.xml" />
      
        <faces:resources />
     
        <bean id="flowMapping" class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
            <property name="order" value="2" />
            <property name="flowRegistry" ref="flowRegistry" />
            <property name="defaultHandler">
                <!-- If no flow match, map path to a view to render; e.g. the "/intro" path would map to the view named "intro" -->
                <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
            </property>
        </bean>
        <bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
            <property name="flowExecutor" ref="flowExecutor" />
        </bean>
    webflow.xml
    Code:
        <flow-executor id="flowExecutor">
            <flow-execution-listeners>
                <listener ref="facesContextListener" />
            </flow-execution-listeners>
        </flow-executor>
    
        <flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices"
            base-path="/WEB-INF/flows">
            <flow-location-pattern value="/**/flow.xml" />
            <flow-location id="parent-flow" path="parent-flow.xml" />
        </flow-registry>
    
        <faces:flow-builder-services id="flowBuilderServices"
            development="true" />
    
        <beans:bean id="facesContextListener"
            class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" />

    PS : i'm using Maven

    Any help will be really appreciate, i already spent 2 days on this problem :/
Working...
X