0down votefavorite
<https://stackoverflow.com/questions/48929215/jackson-upgrade-compatibility-issues-from-2-6-1-to-2-8-7#>
I have upgraded jackson from version 2.6.1 to 2.8.7 in my project recently.
And I'm facing the following issue:
When I try to deserialize the data I get back using an object mapper, if I
don't provide type arguments for constructing from canonical in version
2.6.1, it works fine. So for example, the following code runs fine on 2.6.1:
returnType = "java.util.List";
objectMapper.getTypeFactory().constructFromCanonical(returnType);
But on 2.8.7, it gives an exception. The stacktrace of the exception:
java.rmi.RemoteException: java.lang.NullPointerException:null.
at
com.fasterxml.jackson.databind.type.TypeFactory._fromVariable(TypeFactory.java:1421)
at
com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1182)
at
com.fasterxml.jackson.databind.type.TypeFactory._fromParamType(TypeFactory.java:1404)
at
com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1172)
at
com.fasterxml.jackson.databind.type.TypeFactory._resolveSuperInterfaces(TypeFactory.java:1318)
at
com.fasterxml.jackson.databind.type.TypeFactory._fromClass(TypeFactory.java:1261)
at
com.fasterxml.jackson.databind.type.TypeParser.parseType(TypeParser.java:60)
at com.fasterxml.jackson.databind.type.TypeParser.parse(TypeParser.java:33)
at
com.fasterxml.jackson.databind.type.TypeFactory.constructFromCanonical(TypeFactory.java:544)
at foo.company.package.serialize.Serializer.deserialize(Serializer.java:355)
But if I pass the string with the complete type information, even if only
pass it as Object, ie, returnType = "java.util.List<java.lang.Object>";, it
works fine.
Is there a way to make this backward compatible?
I have also posted a StackOverflow question
here:
https://stackoverflow.com/questions/48929215/jackson-upgrade-compatibility-issues-from-2-6-1-to-2-8-7
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.