The Wayback Machine - https://web.archive.org/web/20210913224557/https://github.com/oracle/graal/issues/515
Skip to content
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

Confusing error message about schema when building native image #515

Open
dsyer opened this issue Jul 4, 2018 · 1 comment
Open

Confusing error message about schema when building native image #515

dsyer opened this issue Jul 4, 2018 · 1 comment

Comments

@dsyer
Copy link

@dsyer dsyer commented Jul 4, 2018

If the JSON configuration for allowed runtime reflection contains a class that is not on the class path, the tool tells me to verify that my configuration matches the schema:

error: Error parsing reflection configuration in /home/dsyer/dev/scratch/graal/reflect.json:
Class no.such.Object not found
Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationFiles.

The error is really that no.such.Object is not on the classpath, so it's confusing to tell me to check the JSON (which is perfectly valid).

Also running native-image -H:PrintFlags+ is an error:

$ native-image -H:PrintFlags+ -cp target/classes/ HelloWorld
Build on Server(pid: 18485, port: 37717)
error: Could not find option 'PrintFlags+'. Did you mean one of these: PrintFlags. Use -H:PrintFlags= to list all available options.

so it isn't helpful even if the JSON is really malformed. If there is a way to print some schema hints from the command line, that's great, but I still don't know what it is.

@cstancu
Copy link
Member

@cstancu cstancu commented Jul 4, 2018

Thanks for reporting this behavior. The correct syntax for -H:PrintFlags= is -H:PrintFlags=<option-category> where the <option-category> is one of User, Expert, Debug. -H:ReflectionConfigurationFiles is in the User category and the help message for it is One or several (comma-separated) paths to JSON files that specify which program elements should be made available via reflection., so it doesn't actually show you the schema.

You are right, the error message is also wrong and it should instead tell you that the class is missing. By the way all this logic is in ReflectionConfigurationParser.java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants