4 Replies Latest reply on Feb 22, 2007 9:57 AM by Milan Agatonovic

    What should happen if exception occurs in Action?

    Milan Agatonovic Newbie

      If my synchronously invoked action class (on node-enter event) throws exception, I cannot delete particular process instance after that:

      [executive] WARN [http-8180-Processor25] JDBCExceptionReporter.logExceptions(71) | SQL Error: 1451, SQLState: 23000
      [executive] ERROR [http-8180-Processor25] JDBCExceptionReporter.logExceptions(72) | Cannot delete or update a parent row: a foreign key cons
      traint fails (`executive_db/jbpm_variableinstance`, CONSTRAINT `FK_VARINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_proces
      sinstance` (`ID_`))
      [executive] ERROR [http-8180-Processor25] AbstractFlushingEventListener.performExecutions(301) | Could not synchronize database state with s
      ession
      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.graph.exe.ProcessInstance#1]
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2476)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2632)
       at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:73)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
      


      I have JBPM tables in the same DB as my app tables. They use the same Hibernate session factory.

      Any hint?
      recommended way to handle runtime exception?
      Thanks
      Milan



        • 1. Re: What should happen if exception occurs in Action?
          Ronald van Kuijk Master

          your action throws an exception and you want to remove the process????????????? Please be more specific

          • 2. Re: What should happen if exception occurs in Action?
            Milan Agatonovic Newbie

            Hi Ronald, you are right.
            I will try to provide details:
            My action class extends springmodules JbpmHandlerProxy which further implements ActionHandler and has execute method:

            public void execute(ExecutionContext executionContext) throws Exception
            

            So, my action is invoked synchronously (on node-enter event) and tries to establish connection with some web service.
            If web service is not reachable, I have java.net.ConnectException thrown from my action class and propagated to my web tier.

            Now, everything would be Ok and expected if I could later delete that process instance, but I can't due to FK constraint.

            Log and other details are provided in first post.
            Thank you.
            Milan

            • 3. Re: What should happen if exception occurs in Action?
              Milan Agatonovic Newbie

              Just to add:
              If I try to delete process instance again by calling:

               context.getGraphSession().deleteProcessInstance(processInstance,
               true, true, true);
              


              I get this exception:
              [executive] DEBUG [http-8180-Processor25] ProcessInstanceAction.cancel(119) | processInstanceId 3
              [executive] ERROR [http-8180-Processor25] PARSER.reportError(33) | <AST>:0:0: unexpected end of subtree
              org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [
              
               select pl
               from org.jbpm.logging.log.ProcessLog as pl
               where pl.token in ()
              
               ]
               at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
               at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
               at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
               at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:235)
               at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
               at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
               at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
               at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
               at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
               at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
               at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1113)
               at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
               at org.jbpm.db.GraphSession.deleteProcessInstance(GraphSession.java:460)
               at org.springmodules.workflow.jbpm31.JbpmTemplate$16.doInJbpm(JbpmTemplate.java:520)
               at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:85)
               at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
               at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:328)
               at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:77)
               at org.springmodules.workflow.jbpm31.JbpmTemplate.cancelProcessInstance(JbpmTemplate.java:513)
               at gleam.executive.service.impl.WorkflowManagerImpl.cancelProcessInstance(WorkflowManagerImpl.java:62)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:203)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:162)
               at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
               at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
               at $Proxy6.cancelProcessInstance(Unknown Source)
               at gleam.executive.webapp.action.ProcessInstanceAction.cancel(ProcessInstanceAction.java:141)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
               at gleam.executive.webapp.action.BaseAction.execute(BaseAction.java:229)
               at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
               at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
               at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
               at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
               at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:375)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at gleam.executive.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:42)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at gleam.executive.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:59)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
               at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
               at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:193)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
               at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
               at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
               at java.lang.Thread.run(Thread.java:595)
              [executive] ERROR [http-8180-Processor25] GraphSession.deleteProcessInstance(470) | org.hibernate.hql.ast.QuerySyntaxException: unexpected e
              nd of subtree [
              
               select pl
               from org.jbpm.logging.log.ProcessLog as pl
               where pl.token in ()
              
               ]
              [executive] WARN [http-8180-Processor25] ActionMapping.findForward(78) | Unable to find 'null' forward.
              [executive] ERROR [http-8180-Processor25] ActionExceptionHandler.logException(145) | org.springframework.orm.hibernate3.HibernateQueryExcept
              ion: unexpected end of subtree [
              
               select pl
               from org.jbpm.logging.log.ProcessLog as pl
               where pl.token in ()
              
               ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [
              
               select pl
               from org.jbpm.logging.log.ProcessLog as pl
               where pl.token in ()
              
               ]
              Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [
              
               select pl
               from org.jbpm.logging.log.ProcessLog as pl
               where pl.token in ()
              
               ]
               at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
               at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
               at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
               at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:235)
               at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
               at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
               at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
               at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
               at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
               at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
               at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1113)
               at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
               at org.jbpm.db.GraphSession.deleteProcessInstance(GraphSession.java:460)
               at org.springmodules.workflow.jbpm31.JbpmTemplate$16.doInJbpm(JbpmTemplate.java:520)
               at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:85)
               at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
               at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:328)
               at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:77)
               at org.springmodules.workflow.jbpm31.JbpmTemplate.cancelProcessInstance(JbpmTemplate.java:513)
               at gleam.executive.service.impl.WorkflowManagerImpl.cancelProcessInstance(WorkflowManagerImpl.java:62)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:203)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:162)
               at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
               at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
               at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
               at $Proxy6.cancelProcessInstance(Unknown Source)
               at gleam.executive.webapp.action.ProcessInstanceAction.cancel(ProcessInstanceAction.java:141)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
               at gleam.executive.webapp.action.BaseAction.execute(BaseAction.java:229)
               at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
               at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
               at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
               at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
               at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:375)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at gleam.executive.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:42)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at gleam.executive.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:59)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
               at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
               at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:193)
               at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
               at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
               at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
               at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
               at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
               at java.lang.Thread.run(Thread.java:595)
              


              Any hint?
              TIA
              Milan

              • 4. Re: What should happen if exception occurs in Action?
                Milan Agatonovic Newbie

                Just to add that I am using:
                jbpm-3.1.3 starters kit.
                The previosly reported exception after trying to delete process instance after FK constrain exception is thrown:

                [executive] ERROR [http-8180-Processor25] PARSER.reportError(33) | <AST>:0:0: unexpected end of subtree
                org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [
                
                 select pl
                 from org.jbpm.logging.log.ProcessLog as pl
                 where pl.token in ()
                
                 ]
                


                is actually my failure, because I did not merge well the "if" condition added in 3.1.3:
                // delete the logs for all the process instance's tokens
                 if ((tokens!=null)
                 && (!tokens.isEmpty())
                 ){
                

                After that I have "only one" exception FK constraint:

                Start deleting process instance
                Deleted process instance
                14:29:16,781 [executive] WARN JDBCExceptionReporter.logExceptions(71) | SQL Error: 1451, SQLState: 23000
                14:29:16,781 [executive] ERROR JDBCExceptionReporter.logExceptions(72) | Cannot delete or update a parent row: a foreign key constraint fail
                s (`executive_db/jbpm_variableinstance`, CONSTRAINT `FK_VARINST_PRCINST` FOREIGN KEY (`PROCESSINSTANCE_`) REFERENCES `jbpm_processinstance`
                (`ID_`))
                14:29:16,781 [executive] ERROR AbstractFlushingEventListener.performExecutions(301) | Could not synchronize database state with session
                org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.graph.exe.ProcessInstance#3]
                 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
                 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                 at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2476)
                 at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2632)
                 at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:73)
                 at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
                 at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
                 at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
                 at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
                 at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
                 at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
                 at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:130)
                 at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:
                48)
                 at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager
                .java:707)
                 at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:
                523)
                 at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:510)
                 at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.jav
                a:310)
                 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
                 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
                 at $Proxy6.cancelProcessInstance(Unknown Source)
                 at gleam.executive.webapp.action.ProcessInstanceAction.cancel(ProcessInstanceAction.java:141)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
                 at gleam.executive.webapp.action.BaseAction.execute(BaseAction.java:229)
                 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
                 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
                 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
                 at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:375)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at gleam.executive.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:42)
                 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at gleam.executive.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:59)
                 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
                 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
                 at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
                 at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:193)
                 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                 at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
                 at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
                 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
                 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
                 at java.lang.Thread.run(Thread.java:595)
                


                TIA
                Milan