Im having a problem with exception handling. If there is an exception thrown in the first state of a flow then a NullPointerException is thrown at AbstractFlowExecutionRepository.getConversation
At the stacktrace you can see an IllegalArgumentException being thrown by the start state of a flow. I have a transition to catch all exceptions and go to a view-state showing an error page.
Doing some debug i reached the piece of code where exception is throwed, it seems the key hasn't been set allready. Searching on google i found an old issue which is supposed to be solved but seems to be the exact problem i have.
I need a way to solve this issue, I would appreciate any help.
Thanks.
Im using spring-web 2.5.6 and spring webflow 2.0.5.RELEASE.
That with EJB3 and JSF.
JBoss 4.2
The xml flow:
The line where it throws the nullpointerCode:<?xml version="1.0" encoding="UTF-8"?> <flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd" start-state="listTM" > <!-- Handlers --> <var name="handler" class="com.idest.base.prototype.handlers.ExceptionThrowerr" /> <view-state id="listTM" > <on-entry> <evaluate expression="handler.throwException()" /> </on-entry> <transition on="paginar" to="listTM" /> <transition on-exception="java.lang.Exception" to="estatFinalError" validate="false" /> </view-state> <view-state id="estatFinalError" view="error.xhtml" /> </flow>
The stacktraceCode:ConversationId conversationId = (ConversationId) ((CompositeFlowExecutionKey) key).getExecutionId();
Code:13:44:37,078 DEBUG [TransitionExecutingFlowExecutionExceptionHandler] Exposing flow execution exception root cause java.lang.IllegalArgumentException: forzada under attribute 'rootCauseException' 13:44:37,078 DEBUG [Transition] Executing [Transition@157f509 on = *, to = estatFinalError] 13:44:37,093 DEBUG [Transition] Exiting state 'listParam' 13:44:37,093 DEBUG [DispatcherServlet] Could not complete request java.lang.NullPointerException at org.springframework.webflow.execution.repository.support.AbstractFlowExecutionRepository.getConversation(AbstractFlowExecutionRepository.java:175) at org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository.updateFlowExecutionSnapshot(DefaultFlowExecutionRepository.java:127) at org.springframework.webflow.engine.impl.FlowExecutionImpl.updateCurrentFlowExecutionSnapshot(FlowExecutionImpl.java:408) at org.springframework.webflow.engine.impl.RequestControlContextImpl.updateCurrentFlowExecutionSnapshot(RequestControlContextImpl.java:209) at org.springframework.webflow.engine.ViewState.updateHistory(ViewState.java:271) at org.springframework.webflow.engine.ViewState.exit(ViewState.java:211) at org.springframework.webflow.engine.Transition.execute(Transition.java:224) at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:377) at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:201) at org.springframework.webflow.engine.support.TransitionExecutingFlowExecutionExceptionHandler.handle(TransitionExecutingFlowExecutionExceptionHandler.java:110) at org.springframework.webflow.engine.FlowExecutionExceptionHandlerSet.handleException(FlowExecutionExceptionHandlerSet.java:113) at org.springframework.webflow.engine.Flow.handleException(Flow.java:608) at org.springframework.webflow.engine.impl.FlowExecutionImpl.tryFlowHandlers(FlowExecutionImpl.java:637) at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleException(FlowExecutionImpl.java:595) at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:223) at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:140) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) at org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:174) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 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:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Thread.java:619)


Reply With Quote