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

fwachs
Champ in-the-making
Champ in-the-making
Alright, the problem was quite simple. I had deployed both rest and explorer webapps without deploying my custom classes to the rest webapp. So whenever the rest app started processing one of the jobs there were on the database it failed because of ClassNotFoundException, of course. It was even harder to catch since both rest and explorer webapps write their logs to catalina.out only.

This thread can now be closed.

jbarrez
Star Contributor
Star Contributor
Okay thanks for reporting back!
Faith in normal JVM operation has been restored 😉