diff --git a/engine/src/networking/com/jme3/network/serializing/serializers/FieldSerializer.java b/engine/src/networking/com/jme3/network/serializing/serializers/FieldSerializer.java index 01c24c454..18c38b955 100644 --- a/engine/src/networking/com/jme3/network/serializing/serializers/FieldSerializer.java +++ b/engine/src/networking/com/jme3/network/serializing/serializers/FieldSerializer.java @@ -51,7 +51,20 @@ import java.util.logging.Level; public class FieldSerializer extends Serializer { private static Map savedFields = new HashMap(); + protected void checkClass(Class clazz) { + + // See if the class has a public no-arg constructor + try { + clazz.getConstructor(); + } catch( NoSuchMethodException e ) { + throw new RuntimeException( "Registration error: no-argument constructor not found on:" + clazz ); + } + } + public void initialize(Class clazz) { + + checkClass(clazz); + List fields = new ArrayList(); Class processingClass = clazz;