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

Closed
wants to merge 9 commits into from
Closed

Confusing error message about schema when building native image. #1573

wants to merge 9 commits into from

Conversation

allandequeiroz
Copy link

@allandequeiroz allandequeiroz commented Aug 6, 2019

Targets Issue #515

Hi there, I just gave a try to help with the issue mentioned above, to do so I've used this small project to create a jar and execute my tests.

How I've performed the tests?
mx native-image -H:ReflectionConfigurationFiles=/Users/a/dev/git/allan/playground/src/main/resources/main.json --debug-attach -jar /Users/a/dev/git/allan/playground/target/playground.jar

In relation to the first problem "The confusing message", the output now looks like:

Listening for transport dt_socket at address: 8000
[playground:65401]    classlist:   2,925.69 ms
[playground:65401]        (cap):   1,788.70 ms
[playground:65401]        setup:  22,722.64 ms
Error: Class com.allandequeiroz.Mian not found in the classpath
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1

In relation to the second problem where the -H:PrintFlags flag usage instructions wasn't correct, the output now looks like:

Listening for transport dt_socket at address: 8000
[playground:85087]    classlist:   3,128.28 ms
[playground:85087]        (cap):   1,921.38 ms
[playground:85087]        setup:   2,554.16 ms
Error: Error parsing reflection configuration in /Users/a/dev/git/allan/playground/src/main/resources/main.json:
Class com.allandequeiroz.Mian not found int the classpath
Verify that the configuration matches the schema described in the -H:PrintFlags=<option-category>(User, Expert, Debug) output for option ReflectionConfigurationFiles.
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1

@allandequeiroz allandequeiroz changed the title Confusing error message about schema when building native image. #515 Confusing error message about schema when building native image. Aug 6, 2019
@graalvmbot
Copy link
Collaborator

Hello Allan de Queiroz, thanks for contributing a PR to our project!

We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address allandequeiroz -(at)- gmail -(dot)- com. You can sign it at that link.

If you think you've already signed it, please comment below and we'll check.

@allandequeiroz
Copy link
Author

allandequeiroz commented Aug 6, 2019

Hello Allan de Queiroz, thanks for contributing a PR to our project!

We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address allandequeiroz -(at)- gmail -(dot)- com. You can sign it at that link.

If you think you've already signed it, please comment below and we'll check.

That's strange, my name is into that very page and I've used that e-mail address to send my signed OCA.

Check it out, look for "Allan de Queiroz" - https://www.oracle.com/technetwork/community/oca-486395.html
Allan De Queiroz - OpenJDK GraalVM

@cstancu sorry for the mention but since you were the one who placed some comments at #515. How to look into this issue with the OCA validation?

Thanks,
Allan

@dougxc
Copy link
Member

dougxc commented Aug 6, 2019

I'll fix the OCA issue. The underlying problem is that the database used by the @graalvmbot is separate from the OCA website.

@graalvmbot
Copy link
Collaborator

Allan de Queiroz has signed the Oracle Contributor Agreement (based on email address allandequeiroz -(at)- gmail -(dot)- com) so can contribute to this repository.

@allandequeiroz
Copy link
Author

Thank you, @dougxc

@cstancu
Copy link
Member

cstancu commented Aug 7, 2019

@allandequeiroz thank you for your contribution. There is some overlap between this PR and #1561 which refactors the error handling in the ReflectionConfigurationParser. I think that throwing a more appropriate error rather than a JSONParserException is a good idea and allows for a better error message, maybe an UnresolvedElementException like we do in the SharedBytecodeParser. Doing that should be easier after the refactoring by @bobmcwhirter is merged.

@cstancu cstancu self-assigned this Aug 7, 2019
@allandequeiroz allandequeiroz closed this by deleting the head repository Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants