Announcement Announcement Module
Collapse
No announcement yet.
WebFlow 2.3.1 exception(Spring + JS2 integration) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebFlow 2.3.1 exception(Spring + JS2 integration)

    Hello

    I'm trying to integrate JSF2 & SWF 2.2(and later) and encounter the following exception in the log.
    I've tried different combinations of the binaries(JSF 2.0.3, 2.0.6, 2.1), SWF(2.2.1, 2.3.1) without success.
    This exception doesn't affect workflow and just annoying.
    My final configuration: SWF 2.3.1, JSF 2.1.7, Spring 3.1, RichFaces 4.2.2

    Please advise on possible solutions.

    ERROR FlowExecutionImpl : FlowExecutionListener threw exception
    java.lang.NullPointerException
    at org.springframework.faces.webflow.FlowFacesContext LifecycleListener.requestProcessed(FlowFacesContex tLifecycleListener.java:45)
    at org.springframework.webflow.engine.impl.FlowExecut ionListeners.fireRequestProcessed(FlowExecutionLis teners.java:98)
    at org.springframework.webflow.engine.impl.FlowExecut ionImpl.start(FlowExecutionImpl.java:237)
    at org.springframework.webflow.executor.FlowExecutorI mpl.launchExecution(FlowExecutorImpl.java:140)
    at org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.handle(FlowHandlerAdapter.java:193)
    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.p rocessRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:473)
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:402)
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:329)
    at org.apache.catalina.core.StandardHostValve.custom( StandardHostValve.java:453)
    at org.apache.catalina.core.StandardHostValve.status( StandardHostValve.java:324)
    at org.apache.catalina.core.StandardHostValve.throwab le(StandardHostValve.java:415)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:191)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:307)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    My webflow.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:webflow="http://www.springframework.org/schema/webflow-config"
    xmlns:faces="http://www.springframework.org/schema/faces"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/webflow-config
    http://www.springframework.org/schem...config-2.3.xsd
    http://www.springframework.org/schema/faces
    http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">

    <!-- Executes flows: the central entry point into the Spring Web Flow system -->
    <webflow:flow-executor id="flowExecutor">
    <webflow:flow-execution-listeners>
    <webflow:listener ref="securityFlowExecutionListener" />
    <!-- webflow:listener ref="facesContextListener" / -->
    </webflow:flow-execution-listeners>
    <webflow:flow-execution-attributes>
    <webflow:redirect-in-same-state value="false"/>
    </webflow:flow-execution-attributes>
    </webflow:flow-executor>

    <!--bean id="facesContextListener"
    class="org.springframework.faces.webflow.FlowFaces ContextLifecycleListener" /-->

    <!-- The registry of executable flow definitions -->
    <webflow:flow-registry id="flowRegistry"
    flow-builder-services="facesFlowBuilderServices">
    <webflow:flow-location-pattern value="**/*.xml" />
    </webflow:flow-registry>

    <!-- Direct usage of Unified EL Parser due to Spring EL Parser limitations(which
    is default now) -->
    <faces:flow-builder-services id="facesFlowBuilderServices"
    enable-managed-beans="true" />

    <!-- Installs a listener to apply Spring Security authorities -->
    <bean id="securityFlowExecutionListener"
    class="org.springframework.webflow.security.Securi tyFlowExecutionListener" />

    <bean id="flowMappings"
    class="org.springframework.webflow.mvc.servlet.Flo wHandlerMapping">
    <property name="flowRegistry" ref="flowRegistry" />
    <property name="order" value="0" />
    </bean>

    <bean class="org.springframework.webflow.mvc.servlet.Flo wHandlerAdapter">
    <property name="flowExecutor" ref="flowExecutor" />
    </bean>

    <!-- To fix error javax.servlet.ServletException: No adapter for handler -->
    <bean
    class="org.springframework.web.servlet.mvc.SimpleC ontrollerHandlerAdapter" />

    </beans>

  • #2
    I'm pretty sure that you need "facesContextListener". Yours is commented out.

    Comment


    • #3
      Thank you, evilcouncil.
      That's weird thing, it is not commented out in the source file .... In any case I just checked that exception still occurs(with running facesContextListener)

      Comment


      • #4
        Hi, guys

        After deeper investigation I found out the following. I have a template page where few images were missing on the file system. I have the following entry in web.xml

        <error-page>
        <error-code>404</error-code>
        <location>/site/error?type=notFound</location>
        </error-page>

        So the system executes few simultaneous requests to the "error" flow.By some reason it gives the exception above in the log. I attached the DEBUG log. Hopefully it will help.

        2012-08-16 01:14:53,529 DEBUG [org.springframework.webflow.execution.factory.Cond itionalFlowExecutionListenerLoader] - <Loaded [2] of possible 2 listeners for this execution request for flow 'error', the listeners to attach are list[org.springframework.faces.webflow.FlowFacesContext LifecycleListener@6e57d55a, org.springframework.webflow.security.SecurityFlowE xecutionListener@4ec5e60d]>
        2012-08-16 01:14:53,530 DEBUG [org.springframework.webflow.conversation.impl.Sess ionBindingConversationManager] - <Locking conversation 177>
        2012-08-16 01:14:53,529 DEBUG [org.springframework.webflow.conversation.impl.Sess ionBindingConversationManager] - <Putting conversation attribute 'flowExecutionSnapshotGroup' with value org.springframework.webflow.execution.repository.i mpl.SimpleFlowExecutionSnapshotGroup@46e83f08>
        2012-08-16 01:14:53,530 DEBUG [org.springframework.webflow.engine.impl.FlowExecut ionImpl] - <Assigned key e178s1>
        2012-08-16 01:14:53,530 DEBUG [org.springframework.webflow.engine.Transition] - <Completed transition execution. As a result, the new state is 'errorpage' in flow 'error'>
        2012-08-16 01:14:53,530 DEBUG [org.springframework.webflow.engine.Transition] - <Completed transition execution. As a result, the new state is 'errorpage' in flow 'error'>
        2012-08-16 01:14:53,530 ERROR [org.springframework.webflow.engine.impl.FlowExecut ionImpl] - <FlowExecutionListener threw exception>
        java.lang.NullPointerException
        at org.springframework.faces.webflow.FlowFacesContext LifecycleListener.requestProcessed(FlowFacesContex tLifecycleListener.java:45)
        at org.springframework.webflow.engine.impl.FlowExecut ionListeners.fireRequestProcessed(FlowExecutionLis teners.java:98)
        at org.springframework.webflow.engine.impl.FlowExecut ionImpl.start(FlowExecutionImpl.java:237)

        Comment


        • #5
          My config (current setup SWF 2.3.1, JSF Mojarra 2.1.11, PrimeFaces 3.4-RC1). This was modified from the booking-faces example found in the SWF distribution.

          Code:
          <!-- Maps request paths to flows in the flowRegistry; e.g. a path of /hotels/booking looks for a flow with id "hotels/booking" -->
          	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
          		<property name="order" value="1"/>
          		<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>
          
          	<!-- Maps logical view names to Facelet templates in /WEB-INF (e.g. 'search' to '/WEB-INF/views/search.xhtml' -->
          	<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/views/" />
          		<property name="suffix" value=".xhtml" />
          	</bean>
          
          	<!-- Dispatches requests mapped to org.springframework.web.servlet.mvc.Controller implementations -->
          	<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
          
          	<!-- Dispatches requests mapped to flows to FlowHandler implementations -->
          	<bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapterHDIV">
          		<property name="flowExecutor" ref="flowExecutor" />
          	</bean>
          
          	<!-- Executes flows: the central entry point into the Spring Web Flow system -->
          	<webflow:flow-executor id="flowExecutor">
          		<webflow:flow-execution-listeners>
          			<webflow:listener ref="facesContextListener"/>
          			<webflow:listener ref="securityFlowExecutionListener" />
          		</webflow:flow-execution-listeners>
          	</webflow:flow-executor>
          	
          	<!-- The registry of executable flow definitions -->
          	<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices" base-path="/WEB-INF/flows">
          		<webflow:flow-location-pattern value="/**/*-flow.xml" />
          	</webflow:flow-registry>
          	
          	<!-- Configures the Spring Web Flow JSF integration (NOTE: development="true" enables hot-reloading of flow definition changes) -->
          	<faces:flow-builder-services id="facesFlowBuilderServices" development="true" />
          
          	<!-- Installs a listener that creates and releases the FacesContext for each request. -->
          	<bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener"/>
          	
          	<!-- Installs a listener to apply Spring Security authorities --> 
          	<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />

          Comment

          Working...
          X