How can we handle of ArrayIndexOutOfBoundsException when getting CoreSession instances?

Hello,

When testing Nuxeo Platform v5.6 with many users (~500 sessions) using our custom plugins (ro.siveco.* packages, see below), we have got the following exception:

...
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: sivDocumentManager
at org.jboss.seam.Component.newInstance(Component.java:2096)
at org.jboss.seam.Component.getInstance(Component.java:1978)
at org.jboss.seam.Component.getInstance(Component.java:1940)
at org.jboss.seam.Component.getInstance(Component.java:1934)
at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2301)
at org.jboss.seam.Component.getValueToInject(Component.java:2253)
at org.jboss.seam.Component.injectAttributes(Component.java:1693)
at org.jboss.seam.Component.inject(Component.java:1511)
at org.nuxeo.ecm.platform.ui.web.util.NuxeoBijectionInterceptor.aroundInvoke(NuxeoBijectionInterceptor.java:55)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.nuxeo.ecm.platform.ui.web.util.NuxeoExceptionInterceptor.aroundInvoke(NuxeoExceptionInterceptor.java:80)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
at ro.siveco.sivadoc.web.actions.RegistrationTreeBean_$$_javassist_19.initialize(RegistrationTreeBean_$$_javassist_19.java)
at sun.reflect.GeneratedMethodAccessor1429.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
at org.jboss.seam.Component.callComponentMethod(Component.java:2201)
at org.jboss.seam.Component.callCreateMethod(Component.java:2124)
at org.jboss.seam.Component.newInstance(Component.java:2084)
... 133 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1107
at org.nuxeo.ecm.core.api.CoreInstance.getSessions(CoreInstance.java:203)
at ro.siveco.sivadoc.helpers.CoreSessionHelper.getRepositorySession(CoreSessionHelper.java:21)
at ro.siveco.sivadoc.web.DocumentManagerBean.initialize(DocumentManagerBean.java:70)
at sun.reflect.GeneratedMethodAccessor1401.invoke(Unknown Source)*

We looked at the root cause (CoreInstance.java:203) and it seems the code is not thread-safe (should it be?). Please, could you give us a hint?

Thanks, Dorin

0 votes

1 answers

1776 views

ANSWER



Thanks for the report, this will be fixed by NXP-11624 in the next hotfix.

0 votes