You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Been working on a project since 2010 in Java, has been migrated through all the versions since. It's essentially outsider art what I'm working on.
Ran into a problem where I tried to serialize a SynchronizedRandomAccessList after migrating from Vectors both of which are part of the Java Standard Library. Easy way to do this, and how I'm going to fix it is simply modify the source of the Java Standard Library to add a no arg constructor for this. I shouldn't have to do this with any library.
What I should be doing is changing Kryo to use the standard strategy to StdInstantiatorStrategy as described in the Kryo Documentation, however KryoNet is using Kryo 2.2.0, instead of 5.0.2 and as such it doesn't exist that far back.
How to fix this:
Update Kryonet to use Kryo 5.x
How to reproduce it:
Try to declare a Instantiate Strategy with the library.
The text was updated successfully, but these errors were encountered:
Can't modifiy the Java Standard Library anyway, so yeah.
Tried a workaround by using SerializationInstaniationStrategy and I'm getting
Caused by: org.objenesis.ObjenesisException: java.io.NotSerializableException: class com.esotericsoftware.kryonet.FrameworkMessage$RegisterTCP not serializable
So yeah, I'm gonna have to switch libraries. Worked 7 years ago when the last version came out, but doesn't work now.
Hey @Daburnell112! This issue is basically a – more up to date – duplicate of #77 or any of the PRs that suggest updating the framework to Kryo 4.0. If you want to use Kryo 5 with Kryonet, your are best off taking a look at any of the forks that have already done this.
I ended up implementing the KryoSerializer class and changing the list to an array, deleting the reference to the list, and then serializing the class with the array.
I think the problem I encountered was that the code button to download a zip uses an outdated version of Kryo in the Jar file that's with the distributable. I built the jar file from one of the branches into a jar file with the latest Kryo build and I think it works.
Apart from that, I think I figured it out so the issue is closed.
Been working on a project since 2010 in Java, has been migrated through all the versions since. It's essentially outsider art what I'm working on.
Ran into a problem where I tried to serialize a SynchronizedRandomAccessList after migrating from Vectors both of which are part of the Java Standard Library. Easy way to do this, and how I'm going to fix it is simply modify the source of the Java Standard Library to add a no arg constructor for this. I shouldn't have to do this with any library.
What I should be doing is changing Kryo to use the standard strategy to StdInstantiatorStrategy as described in the Kryo Documentation, however KryoNet is using Kryo 2.2.0, instead of 5.0.2 and as such it doesn't exist that far back.
How to fix this:
Update Kryonet to use Kryo 5.x
How to reproduce it:
Try to declare a Instantiate Strategy with the library.
The text was updated successfully, but these errors were encountered: