Hi Yu, The type of field `com.twosigma.research.options.optticks.core.types.Event.askPrice` in the original POJO class is Double, right? If it's right, then next step we should find out why source.readUTF() is `java.lang.Integer` instead of Double.
Nathan Yu <nuonathan...@twosigma.com> 于2021年8月13日周五 下午9:05写道: > When the exception is thrown in PojoSerializer for my Event class, > > yoinks > > String subclassName = source.readUTF(); // > subclassName is “java.lang.Integer” > > try { > > actualSubclass = Class.forName(subclassName, true, cl); > > } catch (ClassNotFoundException e) { > > throw new RuntimeException("Cannot instantiate class.", e); > > } > > subclassSerializer = getSubclassSerializer(actualSubclass); > > target = (T) > subclassSerializer.createInstance(); // target is an > Integer instead of my Event class?? > > // also initialize fields for which the subclass serializer is > not responsible > > initializeFields(target); > > > > > > > > *From:* Nathan Yu <nuonathan...@twosigma.com> > *Sent:* Friday, August 13, 2021 8:49 AM > *To:* JING ZHANG <beyond1...@gmail.com>; Schwalbe Matthias < > matthias.schwa...@viseca.ch> > *Cc:* user@flink.apache.org > *Subject:* RE: Bug with PojoSerializer? > java.lang.IllegalArgumentException: Can not set final double field > Event.rating to java.lang.Integer > > > > Does flink provide any hooks for objects before/after they are > serialized/deserialized? >