-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Using netty 4.1.36.Final for MQTT Connection in a native-image with graalVM 19.1.1 dos not work. #1572
Comments
I don't know the exact answer, but from It appears that Netty is attempting to iterate all declared methods of But since dead-code elimination occurs with Substrate, that method, if un-used, is removed from the reflection data and appears to simply not exist. If you add that combination of class ( |
to be fair, even if that method is actually used, it won't be reflectable via There is an outstanding PR, not yet merged, which might solve this also, but it has other more exciting issues at the moment. Until/unless that happens, adding the above solution might help. |
Now 'Im getting a little bit forward and running into the next error
I added further substitution
and in reflection.json
the native-image props - i override the deprecated settings from netty
So I can build the image without any warnings |
@ahelmbr can you share code that can be used to replicate the reported error? I would recommend using the native-image-agent to automatically detect the reflectively accessed elements. Looking at your substitutions I think just
is required. We integrated the same in Netty. A similar integration could be done in JCTools. I think
may break some internal netty assumptions and I don't think it should be needed. I also think that you should remove:
|
Closing this due to inactivity. Please reopen if the issue still persists. |
I'm currently working on a mqtt load generation tool which I would love to distribute as GraalVM Native Image but I'm stuck with some reflection problems.
Steps to reproduce:
@jramirez-isc I hope that this fits this issue. |
For my MQTT client application - using netty 4.1.36.Final
I tried to build a native-image with graalVM 19.1.1
The compilation is successful, the image will be build.
But running the application and trying an MQTT connect throws the following error:
My
native-image.properties are:
Pom.xml dependencies for netty and substrateVM
reflection-config.json - snippet
Any hint what I have to add to reflection-config or to native image properties that netty is working?
Thanks.
The text was updated successfully, but these errors were encountered: