cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 5.11 - ClassNotFound and then found, crazy run

fwachs
Champ in-the-making
Champ in-the-making
Hi all,

I'm having a very rare problem with activiti 5.11 . I have a simple process that only executes code from a certain class, named UpdateSQLProcessTask every x amount of hours.

This is what happened , all in the same run last night while noone had access to the server:

1. First Activiti logs say it couldn't find the java class.


Dec 12, 2012 5:15:22 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiException: couldn't instantiate class com.zukbox.bpmn.process.UpdateSQLProcessTask
        at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:131)
        at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:162)
….
Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: com.zukbox.bpmn.process.UpdateSQLProcessTask
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:81)
        at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:128)
        … 58 more
Caused by: java.lang.ClassNotFoundException: com.zukbox.bpmn.process.UpdateSQLProcessTask
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        [color=#FF0000]at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)[/color]
….

2. That happened for 10 to 12 timers, then it somehow started working, meaning it found the class and managed to run the code inside
the execute method. ( Take note that this stack trace is following the stack trace above, in red to make it more clear)


[color=#FF0000]at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)[/color]
        … 59 more
Dec 12, 2012 5:15:24 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[71397] was updated by another transaction concurrently
        at org.activiti.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:652)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:460)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:167)

3. This morning, I went into Activiti and checked how the jobs were and most of them ran like option n2 but there were a good amount of jobs that failed with n1.

How can I avoid this from happening again? It has happened to me before but I convinced myself that I was nuts and that I made a mistake. This time I'm sure I didn't screw it !

I'm really worried about this situation, please any kind of guidance will be greatly appreciated.

Regards,
Federico
11 REPLIES 11

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
1: classes on  a remote filesystem that is not accessible for a short period?

2: this can happen. Search the forum and docs about optimistic lock exceptions.

3: no idea…

fwachs
Champ in-the-making
Champ in-the-making
1: classes on  a remote filesystem that is not accessible for a short period?

2: this can happen. Search the forum and docs about optimistic lock exceptions.

3: no idea…
Thanks for your interest in this post.

1. Nope, everything is on the same HDD
2. I know it can, not my main concern here though.
3. Same here Smiley Tongue

fwachs
Champ in-the-making
Champ in-the-making
The problem continues to happen no matter what I do…I've tried deploying the jar file multiple times, deleting the entire explorer webapp and deploying it again, etc.

No ideas anyone? Anything Smiley Happy

trademak
Star Contributor
Star Contributor
Hi,

Is this only happening sometimes or can it be easily reproduced? Then I can look into it.

Best regards,

fwachs
Champ in-the-making
Champ in-the-making
Hi,

Is this only happening sometimes or can it be easily reproduced? Then I can look into it.

Best regards,
Nope, there's no easy easy way to reproduce this…It happens with some of my processes but not all of them and only when they are running on a timer, if I execute the job then it all works like it should.

trademak
Star Contributor
Star Contributor
Okay fair enough. Some more questions to get this reproduced then.
Are you using a timer start event? And after this timer start event there's a service task that invokes a Java class?
Are you using a Spring bean with an expression or the class attribute of the service task element?
Did you deploy the JAR to the WEB-INF/lib of the application?
Are you using the Activiti Explorer or a self made application?

Best regards,

fwachs
Champ in-the-making
Champ in-the-making
Okay fair enough. Some more questions to get this reproduced then.
Are you using a timer start event? And after this timer start event there's a service task that invokes a Java class?
Are you using a Spring bean with an expression or the class attribute of the service task element?
Did you deploy the JAR to the WEB-INF/lib of the application?
Are you using the Activiti Explorer or a self made application?

Best regards,

Yes I'm using a timer start event, and yes after that timer there's a service task that executes a Java Delegate.
I'm using the class attribute of the service task element.
The JAR file is on WEB-INF/lib of the explorer webapp (/opt/tomcat-activiti/webapps/activiti-explorer/WEB-INF/lib/).
I'm using the Activiti Explorer, I only changed 2 files: db.properties and activiti-standalone-context.xml, to add a simple spring bean.

[img]https://s3.amazonaws.com/zukbox-test/resources/problem.png[/img]

I've narrowed down the problem to a single process, it's always the same process that it's failling, I could share the xml file via PM if you want.
I've tried re uploading the xml but…same result Smiley Tongue

trademak
Star Contributor
Star Contributor
Hi,

I also did some experiments with a similar process definition and class implementation, and I didn't run into any issues.
What did you define as a Spring bean? Because you said you are using a Java delegate with the class attribute?
Yes, please share your process definition.

Best regards,

fwachs
Champ in-the-making
Champ in-the-making
I've sent the process definition over PM , let me know if you have any doubts or concerns. This continues to be a problem on prod on a daily basis.