Hi there,
I am using Jackson for message serialization and getting the error message:
Type id handling not implemented for type scala.Tuple3 (by serializer of type com.fasterxml.jackson.module.scala.ser.TupleSerializer)
I have below Polymorphic types defined as:
class PyContextMetaType
case class Wpbp (sepInd: Int
, esgGrping: Int
, psaGrping: Int
, pernr: BigInt
, eeGrp: Char
, eeSubGrp: String
, perArea: String
, perSubArea: String
, orgUnit: String
, position: String
, costCenter: String) extends PyContextMetaType
case class IT (var sepInd: Int,
esgGrping: Int,
wtCode: String = "",
wtText: String = "",
var rte: Double = 0,
var num: Double = 0,
var amt: Double = 0,
currency: String = "XXX") extends PyContextMetaType
Then I defined case class LogNode which uses PyContextMetaType as memebers:
case class LogNode(var text: String,
@JsonBackReference
dadNode: Option[AnyRef] = None,
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "PyContextMetaType")
@JsonSubTypes(
Array(
new JsonSubTypes.Type(value = classOf[IT], name = "IT"),
new JsonSubTypes.Type(value = classOf[Wpbp], name = "Wpbp")
))
var data: Option[(List[List[PyContextMetaType]],List[String],List[List[PyContextMetaType]])] = None,
@JsonManagedReference
children: ListBuffer[LogNode] = new ListBuffer[LogNode],
detailText: String = "") extends CborSerializable{
...
...
}
For the “data” member, since it is Polymorphic types, so I added @JsonTypeInfo & @JsonSubTypes.
When doing serialization, the I got error message returned as:
Type id handling not implemented for type scala.Tuple3 (by serializer of type com.fasterxml.jackson.module.scala.ser.TupleSerializer)
How should I solve this? Do I have to define a custom serialier/deserializer for scala.Tuple3? If yes, could you please shed some light?
Thanks in advance