Skip to content
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

Issues with Graal Native Images #160

Open
AnthonyRuffino opened this issue Oct 30, 2020 · 2 comments
Open

Issues with Graal Native Images #160

AnthonyRuffino opened this issue Oct 30, 2020 · 2 comments

Comments

@AnthonyRuffino
Copy link

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

@RobertZenz
Copy link

Can you tell Graal to add no-parameters constructor to all classes?

@AnthonyRuffino
Copy link
Author

I do not think that is a feature of Graal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants