cancel
Showing results for 
Search instead for 
Did you mean: 

StackOverflowError

thomasl
Champ in-the-making
Champ in-the-making
Hello,

I have just come upon the following error when running a (rather large) BPM script:

Caused by: java.lang.StackOverflowError
        at org.activiti.engine.impl.context.Context.getProcessEngineConfiguration(Context.java:56) [activiti-engine-5.14.jar:5.14]
        at org.activiti.engine.impl.history.HistoryManager.recordActivityStart(HistoryManager.java:189) [activiti-engine-5.14.jar:5.14]
        at org.activiti.engine.impl.history.handler.ActivityInstanceStartHandler.notify(ActivityInstanceStartHandler.java:30) [activiti-engine-5.14.jar:5.14]
        at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:42) [activiti-engine-5.14.jar:5.14]

Do you have any idea what met be causing this error ? An issue in my script or an Activiti configuration issue (the issue seems to arise in a ThreadLocal stack read operation, this may be suspicious).

Thanks,

Tom
4 REPLIES 4

thomasl
Champ in-the-making
Champ in-the-making
I tried with an increased JVM stack size (-Xss) and the problem went away. However, is it just a matter of JVM tuning or a symptom that there might be an issue with my script ?
On the whole stack trace, the CommandContext.performOperation() method calls itself a large number of times. Is it a normal Activiti behavior that I need to be aware of ?

Regards,

Tom

jbarrez
Star Contributor
Star Contributor
I'm afraid you hit a long outstanding Activiti bug (indeed with performOperation). When you have a huge number of steps executed in the same transaction, you will see it (99% of users never have so many).
We have a fix for that specific issue, but it makes half of our test suite fail … and we haven't found a better solution yet… But it's something we look into from time to time cause we really are annoyed by it.

gap
Champ in-the-making
Champ in-the-making
I am also experiencing the exact same problem. Have set JVM stack size to 1M but the Exception still occurs after about 20 iterations.
What is the adequate work around, if I have to set up a multi-instance sub-process that has to iterate over a collection with about 6'000 elements?

Thanks a lot for any help.

jbarrez
Star Contributor
Star Contributor
What I said above still holds: its a fundamental issue in Activiti. But we're working on a solution for it (don't expect anything soonish, it's a major refactoring!)

Also: what is the use case for 6000 elements? Is a BPM engine the appropriate tool for this?