EsotericSoftware / kryonet

TCP/UDP client/server library for Java, based on Kryo
BSD 3-Clause "New" or "Revised" License
1.81k stars 416 forks source link

Internal classes must be registered with Kryo before RMI can be used #74

Closed Fr33dan closed 9 years ago

Fr33dan commented 9 years ago

After couple of days fighting with it I finally discovered that RMI does not work until the classes ObjectSpace.InvokeMethod and ObjectSpace.InvokeMethodResult have been registered with the Kryo instance of the connection on both ends:

Kryo kryo = serverClient.getKryo();
kryo.register(com.esotericsoftware.kryonet.rmi.ObjectSpace.InvokeMethod.class);
kryo.register(com.esotericsoftware.kryonet.rmi.ObjectSpace.InvokeMethodResult.class);

I do not know if this is intentional or if it is a bug, if it is intentional it should be listed in the documentation somewhere.

NathanSweet commented 9 years ago

Added text. https://github.com/EsotericSoftware/kryonet/blob/master/README.md#remote-method-invocation