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

RabbitMQ Regression with GraalVM 22.1 #1643

Closed
goafabric opened this issue Jun 16, 2022 · 7 comments
Closed

RabbitMQ Regression with GraalVM 22.1 #1643

goafabric opened this issue Jun 16, 2022 · 7 comments
Labels
for: external-project For an external project and not something we can fix

Comments

@goafabric
Copy link

While the implicit upgrade of paketo to GraalVM 22.1 fixed things for JPA.
It on the other hand broke RabbitMQ Hints

While this branch worked flawlessly 2 months ago (it bootstraps the application during build to verify that application start works)
https://github.com/goafabric/event-dispatcher-service/actions/runs/2225017519

A direct copy now breaks:
https://github.com/goafabric/event-dispatcher-service/actions/runs/2507912855

See error below -- the @Queuebinding inside LoggerAdapter brakes.
Upgrading or downgrading spring (native) wont change anything
The only difference i can spot is graalvm 22.0.1 vs 22.1

I guess the Class LoggerAdapter alone should be enough to cause the behaviour

-- cut ---
com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.springframework.amqp.rabbit.annotation.QueueBinding, interface org.springframework.core.annotation.SynthesizedAnnotation] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles= and -H:DynamicProxyConfigurationResources= options.
1187
2022-06-16 09:09:19.706 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
1188
1189
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loggerAdapter': Initialization of bean failed; nested exception is com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.springframework.amqp.rabbit.annotation.QueueBinding, interface org.springframework.core.annotation.SynthesizedAnnotation] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles= and -H:DynamicProxyConfigurationResources= options.

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

goafabric commented Jun 16, 2022

Honestly .. I would also expect that the graalvm version / paketo build is tied to the spring-native version.
I know that this can be configured manually .. but neither was i able to understand the versioning scheme.

And I think this should be the default behaviour .. otherwise builds are never repeatable .. and thats a huge bummer.

The next Milestone also has a already fixed issue due to GraalVM behaviour change:
#1584

@goafabric goafabric changed the title RabbtiMQ Regression with GraalVM 22.1 RabbitMQ Regression with GraalVM 22.1 Jun 16, 2022
@sdeleuze
Copy link
Contributor

I understand the pain of non repeatable builds with Buildpacks and the fact that the versioning scheme is not easy to understand. I will raise that point to Spring Boot team for Spring Boot 3.

@goafabric
Copy link
Author

@sdeleuze thank you

@goafabric
Copy link
Author

just to add .. its actually the same graalvm 22.1 version here .. just the build packs internal version differ
5.2.1 vs 5.2.3
however i was not able to figure out which parameter that will be .. very confusing
configured to the latest one documented here
https://paketo.io//docs/howto/java/#configure-the-graalvm-version
=>
gcr.io/paketo-buildpacks/java-native-image:5.12.0
=>
this falls back to graalvm 21.3 and than works

@goafabric
Copy link
Author

goafabric commented Oct 14, 2022

With Spring Boot 3.0 M5 it works nearly out of the Box.
Just a hint for RabbitHealthIndicator is missing

`static class ApplicationRuntimeHints implements RuntimeHintsRegistrar {

    @Override
    public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
        registerReflection(RabbitHealthIndicator.class, hints);
    }

    private void registerReflection(Class clazz, RuntimeHints hints) {
        Arrays.stream(clazz.getDeclaredConstructors()).forEach(
                r -> hints.reflection().registerConstructor(r, ExecutableMode.INVOKE));
        Arrays.stream(clazz.getDeclaredMethods()).forEach(
                r -> hints.reflection().registerMethod(r, ExecutableMode.INVOKE));
    }

}`

@wilkinsona
Copy link

Thanks, @goafabric. I think we've fixed that for RC1: spring-projects/spring-boot#32541.

@goafabric
Copy link
Author

@wilkinsona cool thank you

@sdeleuze sdeleuze closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
@sdeleuze sdeleuze added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
for: external-project For an external project and not something we can fix
Development

No branches or pull requests

4 participants