Implementation Provided for Reflection Access to idleTimeMillis() Method at Runtime in Native Image Creation #26387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my Spring Boot project, I am using Hazelcast version 5.0.0.
I am able to create a native image successfully. However, when I run the application, I get the following error at runtime.
This error does not cause the application to shut down.
I reviewed the code. A method is invoked using reflection, but the method is not registered in the hints, so the error occurs.
Method is private long com.hazelcast.internal.networking.nio.NioOutboundPipeline.idleTimeMillis().
I resolved the issue by adding this method to the hints.
Here is a sample project where you can reproduce the error. After cloning the project, follow the steps in the README.md file on the main branch, and you will see the error occur. Switch to the solution branch and follow the steps in the README.md file there, and you will see that the error is resolved. You will see that the service does not throw any errors and running correctly. The relevant code fixes have been made in the solution branch.
By following the steps in the README file, you will see the error occurring in the code on the main branch and observe that it is resolved in the code on the solution branch. I’ve made it easier for you. Thank you.
The branch link where you can reproduce the error : https://github.com/omercelikceng/native-poc-cache-issue/tree/main
The branch link where the error is resolved : https://github.com/omercelikceng/native-poc-cache-issue/tree/solution
Error :