Problem with serializers

I’ve this situation:



ClientToServerMessage:



public class ClientToServerMessage extends Message {

private User user;



}





and the User class is:



@serializer

public class User {

private Integer id;

private Set<Boolean> boolset;

}





to serialize an Integer field I use (but i don’t know if it is correct) in the client and in the server;





Serializer.registerClass(User.class);

Serializer.registerClass(Integer.class, new IntSerializer());





But it doesn’t work…I receive this message on the console:



com.jme3.network.serializing.serializers.FieldSerializer writeObject

Exception occurred on writing. Maybe you’ve forgotten to register a class, or maybe a class member does not have a serializer.





why?

And to serialize a set of Boolean, how can i do?



Thank you.

you have to register the serializers on both the client and the server and in the same order

scrubalub said:
you have to register the serializers on both the client and the server and in the same order

I do this yet...

The Integer.class serializer is already registered. I see some weird code though; what’s @serializer? I think you meant @Serializable :slight_smile: