我有一个 pojo,它有一个CurrencyUnit
来自 javamoney 库的类型字段。当我编组这个 pojo Jackson 时抛出异常。当我没有定义任何默认构造函数时,我记得这个异常。但在这种情况下,我无法维护CurrencyUnit
该类,因为它来自依赖项。我怎样才能使这项工作?
例外:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `javax.money.CurrencyUnit` (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information\n at