EsotericSoftware / EsotericSoftware/kryonet

Issues with Graal Native Images

Open
#160 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
411
PR merge metrics
No merged PRs in 30d

Description

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.(KryoSerialization.java:31)
at com.esotericsoftware.kryonet.KryoSerialization.(KryoSerialization.java:23)
at com.esotericsoftware.kryonet.Server.(Server.java:91)
....

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.