2 Replies Latest reply on May 3, 2010 11:03 AM by Johan Eklund

    Scheduler issue in web app with mixed jBPM and Pageflow

    Johan Eklund Newbie

      Hi everyone,


      I'm trying to get a scheduled reminder to work in my jBPM process:


      <reminder duedate="1 minute" repeat="30 seconds"/>



      This work in the sense that 1 minute after the task has been started/assigned I start getting reminder-emails. But when the task (a nested pageflow) ends with:


      <page name="showIncompleteTasksApprove" view-id="/secure/taskList.jsp">
        <end-task transition="Approve"/>
        <redirect/>
      </page>


      I get this exception:


      14:37:39,174 WARN  [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this opera
      tion breaks ==
      14:37:39,185 ERROR [GraphElement] action threw exception: service 'scheduler' unavailable
      org.jbpm.svc.JbpmServiceException: service 'scheduler' unavailable
           at org.jbpm.svc.Services.getCurrentService(Services.java:97)
           at org.jbpm.svc.Services.getCurrentService(Services.java:87)
           at org.jbpm.scheduler.def.CancelTimerAction.execute(CancelTimerAction.java:45)
           at org.jboss.seam.bpm.SeamUserCodeInterceptor$1.process(SeamUserCodeInterceptor.java:80)
           at org.jboss.seam.bpm.SeamUserCodeInterceptor$ContextualCall.run(SeamUserCodeInterceptor.java:33)
           at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAction(SeamUserCodeInterceptor.java:74)
           at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:254)
           at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:212)
           at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:182)
           at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:166)
           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:597)
           at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java
      :173)
           at org.jbpm.taskmgmt.def.Task_$$_javassist_2023.fireEvent(Task_$$_javassist_2023.java)
           at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:444)
           at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:413)
           at org.jboss.seam.bpm.BusinessProcess.endTask(BusinessProcess.java:214)
           at org.jboss.seam.pageflow.Page.execute(Page.java:103)
           at org.jbpm.graph.def.Node.enter(Node.java:314)
           at org.jbpm.graph.def.Transition.take(Transition.java:151)
           at org.jbpm.graph.def.Node.leave(Node.java:389)
           at org.jbpm.graph.exe.Token.signal(Token.java:192)
           at org.jbpm.graph.exe.Token.signal(Token.java:155)
           at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:283)
           at org.jboss.seam.pageflow.Pageflow.signal(Pageflow.java:485)
           at org.jboss.seam.pageflow.Pageflow.navigate(Pageflow.java:341)
           at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:40)
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
           at javax.faces.component.UICommand.broadcast(UICommand.java:387)
           at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
           at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:755)
           at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
      )
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:54)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           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:182)
      
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
           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)
      



      The task was started with


           @In private Pageflow pageflow;
      
           @StartTask
           public String startTask() {
                pageflow.begin(TaskInstance.instance().getName());
                initializeProcessVariables();
                return SECUREPAGESDIR + TaskInstance.instance().getName() + ".jsp";
           }




      My theory is that, Seam has in some way made the jbpmContext invisible for the nested action endTask and this causes CancelTimerAction to fail in retrieving a reference to the scheduler-service. Without the reminder-tag, ending the task works fine.




      1. Does theory this sound right?

      2. Is there anything I can do about it?



      (This is a continuation of a jBPM forum thread.)