Hello,
currently I experiment with the new Webflow 2.2 release and JSF 2. Using the spring JSF booking sample app as foundation I created a minimal app and try to change some details.
First of all I would like to use the Spring MVC view resolver for resolving Webflow views. For that I added the folowing snippets to the Webflow config file:
and I added this bean to the flow-builder-services:Code:<bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"> <property name="viewResolvers" ref="faceletsViewResolver" /> </bean>
mvcViewFactoryCreator is defined as follows:Code:<faces:flow-builder-services id="facesFlowBuilderServices" view-factory-creator="mvcViewFactoryCreator" development="true" />
After moving the xhtml pages to the correct location the single views are accessible. But starting the flow results in the following error:Code:<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.faces.mvc.JsfView" /> <property name="prefix" value="/WEB-INF/pages/" /> <property name="suffix" value=".xhtml" /> </bean>
Only the first view of the flow is shown, but the navigation is not working anymore. Without changing the view resolving everything works as expected.Code:10:11:01,734 DEBUG FlowHandlerMapping:108 - Mapping request with URI '/webflow/spring/test' to flow with id 'test' 10:11:01,734 DEBUG FlowExecutorImpl:161 - Resuming flow execution with key 'e1s1 10:11:01,734 DEBUG SessionBindingConversationManager:67 - Locking conversation 1 10:11:01,750 DEBUG DefaultFlowExecutionRepository:103 - Getting flow execution with key 'e1s1' 10:11:01,750 DEBUG FlowDefinitionRegistryImpl:59 - Getting FlowDefinition with id 'test' 10:11:01,750 DEBUG ConditionalFlowExecutionListenerLoader:87 - Loaded [1] of possible 1 listeners for this execution request for flow 'test', the listeners to attach are list[org.springframework.faces.webflow.FlowFacesContextLifecycleListener@1786286] 10:11:01,750 DEBUG FlowExecutionImpl:250 - Resuming in org.springframework.webflow.mvc.servlet.MvcExternalContext@2f996f 10:11:01,750 DEBUG ViewState:307 - Rendering + [ServletMvcView@10278c5 view = org.springframework.faces.mvc.JsfView: name 'test/testStart'; URL [/WEB-INF/pages/test/testStart.xhtml]] 10:11:01,750 DEBUG ViewState:308 - Flash scope = map[[empty]] 10:11:01,750 DEBUG ViewState:309 - Messages = [DefaultMessageContext@146df77 sourceMessages = map[[null] -> list[[empty]]]] 10:11:01,750 DEBUG AbstractMvcView:178 - Rendering MVC [org.springframework.faces.mvc.JsfView: name 'test/testStart'; URL [/WEB-INF/pages/test/testStart.xhtml]] with model map [{flowRequestContext=[RequestControlContextImpl@1f93ace externalContext = org.springframework.webflow.mvc.servlet.MvcExternalContext@2f996f, currentEvent = [null], requestScope = map[[empty]], attributes = map[[empty]], messageContext = [DefaultMessageContext@146df77 sourceMessages = map[[null] -> list[[empty]]]], flowExecution = [FlowExecutionImpl@183d260 flow = 'test', flowSessions = list[[FlowSessionImpl@168afdd flow = 'test', state = 'testStart', scope = map['viewScope' -> map[[empty]]]]]]], flashScope=map[[empty]], currentUser=null, flowExecutionKey=e1s1, flowExecutionUrl=/webflow/spring/test?execution=e1s1, viewScope=map[[empty]]}] 10:11:01,750 DEBUG RequestLoggingPhaseListener:42 - Entering JSF Phase: RESTORE_VIEW 1 10:11:01,750 DEBUG JsfView:82 - Asking faces lifecycle to render 10:11:01,750 DEBUG RequestLoggingPhaseListener:42 - Entering JSF Phase: RENDER_RESPONSE 6 10:11:01,765 DEBUG JsfView:85 - View rendering complete 10:11:01,765 ERROR FlowExecutionImpl:276 - FlowExecutionListener threw exception java.lang.NullPointerException at org.springframework.faces.webflow.FlowFacesContextLifecycleListener.requestProcessed(FlowFacesContextLifecycleListener.java:45) at org.springframework.webflow.engine.impl.FlowExecutionListeners.fireRequestProcessed(FlowExecutionListeners.java:98) at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:274) at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:788) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 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:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) 10:11:01,765 DEBUG DefaultFlowExecutionRepository:118 - Putting flow execution '[FlowExecutionImpl@183d260 flow = 'test', flowSessions = list[[FlowSessionImpl@168afdd flow = 'test', state = 'testStart', scope = map['viewScope' -> map[[empty]]]]]]' into repository 10:11:01,765 DEBUG DefaultFlowExecutionRepository:125 - Adding snapshot to group with id 1 10:11:01,765 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[empty]]]] 10:11:01,765 DEBUG SessionBindingConversationManager:99 - Unlocking conversation 1
Could you please help me. Thanks in advance.
Greetings, Dieter


Reply With Quote