-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Native Image Hazelcast error: java.lang.NoSuchMethodError: com.hazelcast.map.IMap.getName() #5604
Comments
Could you please provide a minimal sample project to reproduce this issue so we can more easily investigate and ensure any fix is working properly for your use case? |
This is how far I got with my sample: https://github.com/jonatan-ivanov/ecoli/tree/gh-micrometer-5604-hazelcast-native-image It seems either the Hazelcast version (
The fix is probably fairly simple in Micrometer (we can add runtime hints) but we will need a reproducer first. |
This change reproduces micrometer-metrics/micrometer#5604.
I tried to reproduce it with Hazelcast 5.5.0 but got the same failure as @jonatan-ivanov got above. I was able to reproduce it with Hazelcast 5.2.1 that GraalVM reachability metadata has been tested against. See https://github.com/izeye/hello-hazelcast-java-client/tree/native-image-micrometer |
I created #5618 to try to resolve this. |
"java.lang.NoSuchFieldException: ARTIFACT_ID" seems to have been fixed in hazelcast/hazelcast@f2ff3be that hasn't been released yet. |
Thank you very much @izeye! It seems the highest version that is not broken with Thank you for the PR, I will look into it soon. |
Hi, Sorry for not answering the questions, fortunately you got to the answers quite fast.
Thank you so much! |
Describe the bug
I've run into the same situation as reported here:
https://stackoverflow.com/questions/76807745/hazelcast-with-spring-boot-3-graalvm-native-nosuchmethoderror
Basically, both Hazelcast and Spring Boot are working with Native Image, but sadly Micrometer's
HazelcastCacheMetrics
breaks this compatibility with:java.lang.NoSuchMethodError: com.hazelcast.map.IMap.getName()
There is no workaround available, sadly.
Extended stacktrace:
Environment
Error happens on latest version of micrometer, coming from this line:
~https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/HazelcastIMapAdapter.java#L53
To Reproduce
How to reproduce the bug:
Expected behavior
This reflective operation should be compatible with native image generation.
Additional context
Add any other context about the problem here, e.g. related issues.
The text was updated successfully, but these errors were encountered: