Skip to content

Native image blows up when it accesses Method.getDefaultValue() #1135

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

Closed
dsyer opened this issue Apr 5, 2019 · 2 comments
Closed

Native image blows up when it accesses Method.getDefaultValue() #1135

dsyer opened this issue Apr 5, 2019 · 2 comments
Assignees

Comments

@dsyer
Copy link

dsyer commented Apr 5, 2019

Annotation classes have Methods with default values. It is useful to access the default value reflectively, but it blows up in a native image, even if you declare the annotation type in reflect-confg.json.

Here's an example error:

Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Unsupported method java.lang.Class.getConstantPool() is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:102)
	at java.lang.Class.getConstantPool(DynamicHub.java)
	at java.lang.System$2.getConstantPool(System.java:1227)
	at java.lang.reflect.Method.getDefaultValue(Method.java:609)
	at com.sample.App.main(App.java:23)

Sample project: sdeleuze/graalvm-native-issues#9

@dsyer
Copy link
Author

dsyer commented Apr 5, 2019

Similar to #1170 (arises in a similar use case) but the error is different, so possibly not the same thing.

@cstancu
Copy link
Member

cstancu commented Apr 19, 2019

This is fixed by ef950cc.

@cstancu cstancu closed this as completed Apr 19, 2019
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

3 participants