aleph

lukasz 2020-06-12T14:22:09.018900Z

Hi! 👋 I'm working on a UDP server, based on Aleph. The idea is to eventually ship it as a single binary, compiled via native-image. I got to the point where a binary is produced but I'm running into an issue: When the server starts I get an exception that NioDatagramChannel doesn't have a 0-arity public constructor https://github.com/ztellman/aleph/blob/d3dc2e9835b58fb53b957171765e8da68e52aa84/src/aleph/udp.clj#L51 The error doesn't happen when running the code directly via Lein or good old uberjar. Has anybody run into this problem? Or should I ask in #graalvm channel?

1
valerauko 2020-06-12T14:25:37.019100Z

are you building for graal? that's impressive. i'd definitely wanna know how you achieved that. i couldn7t get netty to compile for graal yet.

lukasz 2020-06-12T14:26:51.019400Z

Yeah, it works for the most part: https://github.com/lukaszkorecki/graleph

👍 1
valerauko 2020-06-12T14:27:07.019700Z

as for your problem, what are the versions of libraries (netty?) you're using? because 4.1.50-line does have a 0-arity constructor https://netty.io/4.1/api/io/netty/channel/socket/nio/NioDatagramChannel.html

lukasz 2020-06-12T14:27:49.019900Z

That's the confusing part - I pinned all dependencies to 4.1.50-Final to make sure I'm using the right version

lukasz 2020-06-12T14:28:14.020100Z

Let me gist the stack trace I get from the native-image version of the server

👍 1
valerauko 2020-06-12T14:32:54.020600Z

can you check where your stuff gets installed to see what version of netty you actually get? because even 4.0 seems to have a 0-arity constructor for the class in question

valerauko 2020-06-12T14:43:52.020800Z

also, does this happen if you run your native-image compiled binary outside of docker?

lukasz 2020-06-12T14:51:58.021Z

The dependencies are correct, according to lein deps :tree output - everything is pointing at 4.1.50-Final version

lukasz 2020-06-12T14:52:20.021200Z

Let me check running the binary outside of Docker - I develop in a Linux VM anyway, but worth double checking that

lukasz 2020-06-12T14:53:48.021400Z

Yep, same error

valerauko 2020-06-12T15:02:20.021600Z

does the same binary fail inside the linux vm?

lukasz 2020-06-12T15:05:06.021800Z

Yeah. Looks like it's related to the reflection config - more discussion on #graalvm channel.