Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Class com.ecwid.consul.v1.kv.model.GetValue is instantiated reflectively but was never registered #1430

Closed
sergey-morenets opened this issue Jan 7, 2022 · 7 comments · Fixed by #1520
Assignees
Labels
type: bug A general bug
Milestone

Comments

@sergey-morenets
Copy link

sergey-morenets commented Jan 7, 2022

Hi

We have Spring Boot application that uses Spring Cloud Config Consul. We added Spring Native plugin (for Gradle) and managed to build GraalVM native image however when we run the application we get the following exception:

Caused by: java.lang.IllegalArgumentException: Class com.ecwid.consul.v1.kv.model.GetValue is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection
at com.oracle.svm.core.graal.snippets.SubstrateAllocationSnippets.hubErrorStub(SubstrateAllocationSnippets.java:258)
at sun.misc.Unsafe.allocateInstance(Unsafe.java:864)
... 43 common frames omitted

JDK: 17.0.1
GraalVM: 21.3.0
Spring Boot: 2.6.2
Spring Native: 0.11.1
Spring Cloud: 2021.0.0

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 7, 2022
@sergey-morenets
Copy link
Author

Can be resolved by this explicit configuration:

@Configuration
@TypeHint(types = GetValue.class, access = {TypeAccess.PUBLIC_CONSTRUCTORS, TypeAccess.PUBLIC_METHODS, TypeAccess.PUBLIC_FIELDS,
		TypeAccess.DECLARED_CONSTRUCTORS, TypeAccess.DECLARED_FIELDS, TypeAccess.DECLARED_METHODS})
public class AotConfig {
}

@sdeleuze
Copy link
Contributor

sdeleuze commented Feb 1, 2022

@OlgaMaciaszek Should we include that in Spring Cloud hints from your POV?

@OlgaMaciaszek
Copy link
Contributor

@sergey-morenets thanks for reporting this. Veryfying.

@OlgaMaciaszek
Copy link
Contributor

@sergey-morenets I've tried to reproduce this both against 0.10.6 and 0.11.2. However, I was not able to reproduce the issue. Instead, I've come across another issue related to using Spring Cloud Consul with native images. Please provide a minimal, complete, verifiable example that reproduces the issue - will look further into it then.

@sdeleuze
Copy link
Contributor

Closing due to lack of feedback.

@sdeleuze sdeleuze removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 18, 2022
@OlgaMaciaszek
Copy link
Contributor

@sergey-morenets, @sdeleuze after further analysis, I was able to reproduce this.

@OlgaMaciaszek OlgaMaciaszek reopened this Mar 3, 2022
@OlgaMaciaszek OlgaMaciaszek self-assigned this Mar 3, 2022
@OlgaMaciaszek OlgaMaciaszek added the type: bug A general bug label Mar 3, 2022
@OlgaMaciaszek OlgaMaciaszek added this to the 0.11.4 milestone Mar 3, 2022
@OlgaMaciaszek
Copy link
Contributor

Will add the necessary hints.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A general bug
Development

Successfully merging a pull request may close this issue.

4 participants