cancel
Showing results for 
Search instead for 
Did you mean: 

Execution Listener works on event=start but crashes when i change it to event=end

jhahn
Champ in-the-making
Champ in-the-making
I need to delete certain tasks when this receiveTask ends.

     ….
     <receiveTask id="waitAPI" name="Wait for API response">
        <extensionElements>
          <activiti:executionListener event="end" class="com.____.executionListeners.DeleteTasksOnMessageReceive">
            <activiti:field name="deleteTaskDefinitionKey">
              <activiti:string><![CDATA[test]]></activiti:string>
            </activiti:field>
          </activiti:executionListener>
        </extensionElements>
      </receiveTask>
      ….

If I have it to event="start", it calls the class notify function fine with "test" being assigned to the Private Expression deleteTaskDefinitionKey in the class. But when I switch it to event="end", it throws a class not found exception and fails to call the function.

I spent few hours this morning trying to figure this out and I am pretty much stuck on this issue.

01:52:04,673 [pool-2-thread-1] ERROR org.activiti.engine.impl.cmd.JobRetryCmd  - activitiy or FailedJobRetryTimerCycleValue is null in job 10782290'. only decrementing retries.
01:52:04,677 [pool-2-thread-1] ERROR org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable  - Job 10782290 failed


Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: com.____.executionListeners.DeleteTasksOnMessageReceive
   at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:87)
   at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:134)
   … 44 more
Caused by: java.lang.ClassNotFoundException: com.____.executionListeners.DeleteTasksOnMessageReceive
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
4 REPLIES 4

jhahn
Champ in-the-making
Champ in-the-making
Whoops, didn't use code blocks…

<code>
    <receiveTask id="waitAPI" name="Wait for API response">
      <extensionElements>
          <activiti:executionListener event="end" class="com.____.executionListeners.DeleteTasksOnMessageReceive">
            <activiti:field name="deleteTaskDefinitionKey">
              <activiti:string><![CDATA[test]]></activiti:string>
            </activiti:field>
          </activiti:executionListener>
        </extensionElements>
      </receiveTask>
</code>

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Caused by: java.lang.ClassNotFoundException: com.____.executionListeners.DeleteTasksOnMessageReceive

Did you add class to the classpath?

Regards
Martin

jhahn
Champ in-the-making
Champ in-the-making
I think my comment is waiting approval from mods but going to post an update anyway.

Yes, the class is in the class path, which explains why it works when event="start" but it doens't work on event="end".

Until now, I've been working with the REST API to send a "action": "signal" to an execution. I have my execution listener on event="start". When I do a PUT /executions/{executionId}  with  "action": "signal", it works fine.

But when I use Java processEngine.getRuntimeService().signal(executionId); it throws the same class not found error.
Why would it work with the restAPI but no the java call (with the same executionId)…

This is such a confusing case and I'm wondering if there are inconsistencies between the REST API vs Java. Both are are 5.17.0.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Could you create failing jUnit test please?
http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.