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

Closed
dsyer opened this issue Jul 4, 2018 · 2 comments
Closed

Confusing error message about schema when building native image #515

dsyer opened this issue Jul 4, 2018 · 2 comments
Assignees

Comments

@dsyer
Copy link

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 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.

@spavlusieva
Copy link
Member

hi @dsyer , this issue has been inactive for more than 180 days. We’ll close it to focus on current issues. In case it’s still relevant, please reopen it and we’ll take another look. Thank you!

@spavlusieva spavlusieva closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants