After an upgrade Alfresco form version 5.2 to version 6.2 it became unstable: sometimes we got :
org.mybatis.spring.MyBatisSystemException: nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Error instantiating class java.util.ArrayList with invalid types () or values
Usually during .parallel(). collection execution. There is full stack trace https://pastebin.com/7d7NBwkn and there is the code https://pastebin.com/RyPt5d0g . Actually I even can not understand a flow of control, why MyBatis is involved?
Please help me!
Thank you!
PS: Actually this error is not reproducible well. This exception doesn't rise when I remove .parallel(). and use single thread stream processing.
UPD: the following code rises an exception in case of .parallel(). execution and does not rise an exception in case of serial execution:
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission("accessDeclaredMembers"));
}
UPD 2 SOLUTION: in Alfresco version 5.2 System.getSecurityManager() == NULL (!!!) but in version 6.2. it has been set up. That is the matter of different behavior (details in https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ForkJoinPool.html). V 6.2 set up the SecurityManager and v 5.2. doesn't. The solution was the replacement catalina.sh in Dockerfile to new modified cataliha.sh which has removed security JVM options.