Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4446

ViewScopeBeanHolder register for Quarkus native image

    XMLWordPrintableJSON

Details

    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)
      

      Attachments

        Activity

          People

            melloware Melloware
            melloware Melloware
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: