Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3-next-M7
-
None
Description
Because ViewScopeBeanHolder has a `private static final Random RANDOM_GENERATOR = new Random();` for creating GraalVm native images this class must be registered as a special native runtime initialization class.
Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected. To see how this object got instantiated use --trace-object-instantiation=java.util.Random. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point. at parsing org.apache.myfaces.cdi.view.ViewScopeBeanHolder.generateUniqueViewScopeId(ViewScopeBeanHolder.java:222)