Skip to content

[GR-65589] Provide a concrete action in dynamic access error messages. #11504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

graalvmbot
Copy link
Collaborator

The new messages for reflection look like:

Cannot reflectively access the class 'HelloWorld$TargetClass'. To allow this operation, add the following to the 'reflection' section of the 'reachability-metadata.json' and rebuild the native image:

   {
     "type": "HelloWorld$TargetClass"
   }

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection

Cannot reflectively access the proxy class inheriting ['java.lang.Runnable']. To allow this operation, add the following to the 'reflection' section of the 'reachability-metadata.json' and rebuild the native image:

   {
     "type": {
       "proxy": [
         "java.lang.Runnable"
       ]
     }
   }

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection

Cannot reflectively access the lambda-proxy class declared in 'HelloWorld' inheriting ['java.lang.Runnable']. To allow this operation, add the following to the 'reflection' section of the 'reachability-metadata.json' and rebuild the native image:

   {
     "type": {
       "lambda": {
         "declaringClass": "HelloWorld",
         "interfaces": [
           "java.lang.Runnable"
         ]
       }
     }
   }

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection

And for resources:

Cannot access resource at path 'path/to/resource'. To allow this operation, add the following to the 'resources' section of the 'reachability-metadata.json' and rebuild the native image:

   {
     "glob": "path/to/resource"
   }

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources

Other access will have a similar shape.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 1, 2025
@graalvmbot graalvmbot force-pushed the vj/GR-65589-fix-reflection-error-messages branch 5 times, most recently from 4e352e4 to 2284463 Compare July 2, 2025 16:34
@graalvmbot graalvmbot force-pushed the vj/GR-65589-fix-reflection-error-messages branch 2 times, most recently from b375545 to 2a28fc1 Compare July 3, 2025 12:43
@graalvmbot graalvmbot force-pushed the vj/GR-65589-fix-reflection-error-messages branch from 2a28fc1 to c5d892d Compare July 3, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants