-
Notifications
You must be signed in to change notification settings - Fork 159
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
GraalVM Native SocketDataPort ClassNotFoundException again #1021
Comments
We are aware that nats is not GraalVM friendly but as you said it's pretty plain vanilla, so it can't to too far, but needs a full analysis. |
@Alfablos Can you try this snapshot: 2.17.1.GraalVM-remove-reflection-SNAPSHOT Not sure how you get your dependencies. For gradle and maven, you can get instructions here: If you need, I could get you the jar directly. There is also a branch in the repo: https://github.com/nats-io/nats.java/tree/GraalVM-remove-reflection |
Also, there may be issues compiling directly with Java 17 |
Thank you! I have an exception related to Jackson trying to deserialize the message payload but I'm not sure this is something that needs to be addressed your side.
Deserialization fails with this error:
I haven't tried using a conventional class though. I always get this error regardless of the usage of GraalVM: Java 17 + GraalVM: same jackson error with the SNAPSHOT version, ClassNotFoundException (SocketDataPort) with the stable one. :) |
The library does not use jackson so that is on your side. I saw that the GraalVM docs have specific notes about serialization, I would start there. As far as the |
But again, this is most likely on me. This little repo is a draft for testing some functionalities and I wasn't that careful about configuration. I mentioned It in case It was "clearly" something wrong :) Should I expect the fix for the ClassNotFoundException coming to a stable release anytime soon? Thank you very much! |
Yeah, I'll merge that in and will be available in a couple weeks. As soon as I merge it will be available in the 2.17.1-SNAPSHOT |
Thank you :) |
Observed behavior
Hello,
I'm trying to build a small program as a binary using GraalVM Native.
It compiles fine but when I run the executable the following exception is thrown:
I've searched for similar issues and the only one I found is this one (116) from micronaut-nacts, Graalvm - Nats - Problems when running the application.
It appears that the solution was confirmed here.
This all dates back to 2020. I'm not using any particular framework, just vanilla Java for now and I'm unsure about how to have that class resolved.
Thank you
Expected behavior
Binary executable runs with no exceptions.
Server and client version
nats-server 2.10.3
jnats 2.17.1, 2.16.11
GraalVM (JDK) 17, 21
gradle 8.3
Host environment
EndeavourOS (Arch)
build.gradle.kts
Steps to reproduce
Create an instance of "Connection" by connecting to a server and then run the task nativeRun in gradle (or nativeCompile and then run the executable).
The text was updated successfully, but these errors were encountered: