Java 17 migration - InaccessibleObjectException

Hello,

We recently updated our camunda-bpm-spring-boot-starter to 7.17.0 in order to update to java 17.
The camunda update went well but when we migrated to java 17, a java.lang.reflect.InaccessibleObjectException appeared in our bpmn unit tests.

However, we don’t see this exception when running the application.

I know there is a workaround consisting in changing the jvm args on the unit tests execution to open the java.util module but I’d like a more durable resolution of my issue. I don’t feel confident running my application in production with the jvm customized for my unit tests.

Could anyone help me with this issue ?

Thanks :slight_smile:

Stacktrace:

java.lang.reflect.InaccessibleObjectException: Unable to make public int java.util.ImmutableCollections$List12.size() accessible: module java.base does not “opens java.util” to unnamed module @1f57539
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at org.camunda.bpm.engine.impl.javax.el.BeanELResolver.findAccessibleMethod(BeanELResolver.java:97)
at org.camunda.bpm.engine.impl.javax.el.BeanELResolver.findMethod(BeanELResolver.java:505)
at org.camunda.bpm.engine.impl.javax.el.BeanELResolver.invoke(BeanELResolver.java:474)
at org.camunda.bpm.engine.impl.el.AbstractElResolverDelegate.invoke(AbstractElResolverDelegate.java:97)
at org.camunda.bpm.engine.impl.javax.el.CompositeELResolver.invoke(CompositeELResolver.java:397)
at org.camunda.bpm.engine.impl.juel.AstMethod.invoke(AstMethod.java:91)
at org.camunda.bpm.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
at org.camunda.bpm.engine.impl.juel.AstBinary$SimpleOperator.eval(AstBinary.java:27)
at org.camunda.bpm.engine.impl.juel.AstBinary.eval(AstBinary.java:106)
at org.camunda.bpm.engine.impl.juel.AstBinary$2.eval(AstBinary.java:38)
at org.camunda.bpm.engine.impl.juel.AstBinary.eval(AstBinary.java:106)
at org.camunda.bpm.engine.impl.juel.AstEval.eval(AstEval.java:50)
at org.camunda.bpm.engine.impl.juel.AstNode.getValue(AstNode.java:26)
at org.camunda.bpm.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
at org.camunda.bpm.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:40)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:58)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:92)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:63)
at org.camunda.bpm.engine.impl.el.JuelExpression.getValue(JuelExpression.java:60)
… 158 common frames omitted

Update : I tried switching camunda version from 7.17.0 to 7.18.0-alpha2 and it started working again.
I will not keep an alpha version but can someone tell me if there has been changes in some of the classes of the stacktrace that could explain why it works with the alpha version ?