-
1. Re: [8.1.0.CR2] jackson.map.annotate.JsonSerialize suddenly not working
ctomc May 13, 2014 6:00 AM (in response to tole42)Hey,
We have yet to compile changes list for release notes.
What you are seeing is most probably caused by switching default jackson provider to jackson2 (from jackson1)
which was highly demanded change and in general works much better and faster + has lots of new features that applications can utilize.
In any case, to me it looks like newer json response you get now is correct and old one was wrong, you are serializing Long object which doesn't have to be quoted as a string.
Maybe just annotations are not applied properly, try upgrading compile dependency in your application to jackson2 it might fix the problem.
-
2. Re: [8.1.0.CR2] jackson.map.annotate.JsonSerialize suddenly not working
tole42 May 13, 2014 8:18 AM (in response to ctomc)1 of 1 people found this helpfulthanks for your quick reply and leading me to the right track.
I have to quote the Long as string. Otherwise my javascript is not able to parse the value (In JavaScript, all numbers are 64 bits floating point numbers).
I changed my imports (and pom.xml) from
import org.codehaus.jackson.map.annotate.JsonSerialize; import org.codehaus.jackson.map.ser.std.ToStringSerializer;
to
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
new pom.xml:
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${version.jackson-core}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>${version.jackson-core-annotation}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${version.jackson-core-databind}</version> <scope>provided</scope> </dependency>
now everything is working. thanks!