kryonet
kryonet copied to clipboard
Issues with Graal Native Images
I am trying to run an application as a Graal Native image which sets up a simple Kryonet server from the examples on this git page, but I have coming across the following issue. Any chance the devs of this project could make asmall working example of a Kryonet server ruinning as a native image?
Exception in thread "main" java.lang.IllegalArgumentException: Unable to create serializer "com.esotericsoftware.kryo.serializers.FieldSerializer" for class: com.esotericsoftware.kryonet.FrameworkMessage$RegisterTCP
at com.esotericsoftware.kryo.factories.ReflectionSerializerFactory.makeSerializer(ReflectionSerializerFactory.java:48)
at com.esotericsoftware.kryo.factories.ReflectionSerializerFactory.makeSerializer(ReflectionSerializerFactory.java:26)
at com.esotericsoftware.kryo.Kryo.newDefaultSerializer(Kryo.java:351)
at com.esotericsoftware.kryo.Kryo.getDefaultSerializer(Kryo.java:344)
at com.esotericsoftware.kryo.Kryo.register(Kryo.java:365)
at com.esotericsoftware.kryonet.KryoSerialization.
Caused by: java.lang.InstantiationException: Type com.esotericsoftware.kryo.serializers.FieldSerializer can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
at java.lang.Class.newInstance(DynamicHub.java:850)
at com.esotericsoftware.kryo.factories.ReflectionSerializerFactory.makeSerializer(ReflectionSerializerFactory.java:43)
... 11 more
Can you tell Graal to add no-parameters constructor to all classes?
I do not think that is a feature of Graal.