I do not understand it ,too. Hope someone could explain the reason.
Following up on this matter, I have some more info.
The fact is that eventually the program stops running, but this only happens about 30 to 60 seconds after the last instruction in the code was run.
Alternatively, I tried the return instruction which had the same outcome. The only one that did the job was System.exit(0);
So would like to ask if using the System.exit is the best approach or should I file a bug?
Would really appreciate the help on this matter.
Finally figured what was causing the problem.
After downloading the jbpm code was able to figure out that there was a problem with the MinaTaskClientConnector class in the disconnect method.
The connector variable was not being disposed and that's why not closing the socket thread.
So created a Jira issue and posted a fix, lets hope it gets integrated with the main project.