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

BeanInstantiationException: Failed to instantiate AnnotationConfigApplicationContext with GraalVM 19.2.1 #35

Open
TheOneAndOnlyAndreKempe opened this issue Jan 27, 2020 · 0 comments

Comments

@TheOneAndOnlyAndreKempe
Copy link

TheOneAndOnlyAndreKempe commented Jan 27, 2020

Hej,

I'm trying to create a simple sample project that is very similar to the one you provided (springmvc-tomcat) using GraalVM 19.2.1

The build runs fine. However, when I run the final binary, it throws an exception

Jan 27, 2020 11:06:12 AM org.springframework.boot.SpringApplication reportFailure
SEVERE: Application run failed
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.annotation.AnnotationConfigApplicationContext]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:145)
	at org.springframework.boot.SpringApplication.createApplicationContext(SpringApplication.java:588)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
	at com.ak.graalvmdemo.GraalVMDemoApplication.main(GraalVMDemoApplication.java:10)
Caused by: java.lang.NoSuchMethodException: org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>
	at java.lang.Class.getConstructor0(DynamicHub.java:3082)
	at java.lang.Class.getDeclaredConstructor(DynamicHub.java:2178)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:138)
	... 5 more

I am using

  • spring-graal-native-feature at version 0.6.0 GitRef 275d9ca
  • SpringBoot 2.2.3
  • javac packed with GraalVM.

Is there anything I can do to make this work?

Thanks for your help,
André

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

No branches or pull requests

1 participant