title: Serializing quickfix.Message with Kryo
body: <p>I'm trying to serialize a <code>quickfix.Message</code> instance using kryo serialization.</p>
  
  <p>I'm using kryo version 3.0.3.</p>
  
  <p>The code snippet is as follows:</p>
  
  <pre><code>    Message fixMessage = getFixMessage();
  
      Kryo kryo = new Kryo();
      kryo.register(Message.class);
  
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      Output output = new Output(outputStream);
      kryo.writeObject(output, fixMessage);
      output.flush();
      byte[] result = outputStream.toByteArray();
      output.close();
  
      ByteArrayInputStream inputStream = new ByteArrayInputStream(result);
      Input input = new Input(inputStream);
  
      Message fixMessage2 = kryo.readObject(input, Message.class);
  </code></pre>
  
  <p>and I keep getting this error:</p>
  
  <blockquote>
    <p>com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): quickfix.StringField
    Serialization trace:
    fields (quickfix.Message)
        at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1272) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1078) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1087) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:570) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:546) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:790) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:161) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:39) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:708) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:551) ~[kryo-3.0.3.jar:?]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:686) ~[kryo-3.0.3.jar:?]</p>
  </blockquote>
  
  <p>if I register a kryo's <code>JavaSerializer</code> like this:</p>
  
  <pre><code>kryo.register(Message.class, new JavaSerializer());
  </code></pre>
  
  <p>I get this one:</p>
  
  <blockquote>
    <p>com.esotericsoftware.kryo.KryoException: Error during Java deserialization.
        at com.esotericsoftware.kryo.serializers.JavaSerializer.read(JavaSerializer.java:65) ~[kryo-3.0.3.jar:?]</p>
  </blockquote>
  
  <p>I start to think that this object simply can't be serialized using kryo...</p>
  
  <p>Any thoughts on the issue will be much appreciated.</p>