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

UnsupportedFeatureError: Unresolved element found at runtime #622

Closed
dsyer opened this issue Aug 20, 2018 · 4 comments
Closed

UnsupportedFeatureError: Unresolved element found at runtime #622

dsyer opened this issue Aug 20, 2018 · 4 comments
Assignees

Comments

@dsyer
Copy link

dsyer commented Aug 20, 2018

If you build a native image with --report-unsupported-elements-at-runtime from code that does this:

		try {
			return NonExistentClass.class.isAssignableFrom(myClass);
		}
		catch (Throwable ex) {
			return false;
		}

it fails at runtime with UnsupportedFeatureError: Unresolved element found (a bit like #511 but different I think). You can work around it by doing a check for Class.forName("com.acme.NonExistentClass") before trying isAssignableFrom() it. Seems wrong, because a normal JVM behaves differently.

@dsyer
Copy link
Author

dsyer commented Sep 4, 2018

Ping on this. I found another instance of this in Spring Boot (in addition to the two above). If Graal could just throw NoClassDefFoundError like a normal VM it would make these code paths work as expected. Is there any reason not to do that?

@n0mer
Copy link

n0mer commented Nov 9, 2018

@cstancu are you maybe ready to share updates on this ticket?

@cstancu
Copy link
Member

cstancu commented Nov 9, 2018

We have a new, experimental flag: --allow-incomplete-classpath which should take care of cases like this. You can try it by building GraalVM from source. This will be available in the next release, rc10.

@cstancu
Copy link
Member

cstancu commented Mar 15, 2019

This is now supported via the --allow-incomplete-classpath flag.

@cstancu cstancu closed this as completed Mar 15, 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