Since the move to CXF, JSON serialization is now completely broken a a number of REST endpoints, and different then the previous output on some others.
This is not an exhaustive list, but it demonstrates some of the current problems.
In CXF, we're currently using Jackson as a JSON provider, whereas in Jersey we used a mapper that leveraged the existing JAXB annotations.
An attempt to use Jettison as a JSON provider in CXF fixed the exceptions and overflow errors, but produced different JSON output then what was previously rendered.
The easiest and best option was "Use the Jackson JAXB JSON serializer". It appears to work the same as the old Jersey serializer. I switched everything back in develop and the JSON tests that I wrote for 16 worked in 17. Marking as fixed.
commit 3f43e56dcd892d112e6ef4765517d1a21bfe9d29
Seth Leger July 16, 2015 at 2:46 PM
I'm going to go back to the release-16.0.3 branch and write a bunch of unit tests for JSON serialization there (that will pass because 16 is using Jersey and the Jersey JAXB JSON serialization). Then I'll merge the unit tests forward and see what is failing under CXF and try and figure out a way to make the serialization identical. There are several options for fixing the problems:
Use the Jersey JAXB JSON serializer in CXF for REST v1
Use the Jackson JAXB JSON serializer (which we haven't used before anywhere)
Add annotations to make the Jackson JSON serializer behave the same as Jersey JAXB JSON
Since the move to CXF, JSON serialization is now completely broken a a number of REST endpoints, and different then the previous output on some others.
These URLs fail with overflow errors:
curl -v -H "Accept: application/json" -u admin:admin http://127.0.0.1:8980/opennms/rest/outages
curl -v -H "Accept: application/json" -u admin:admin http://127.0.0.1:8980/opennms/rest/resources
curl -v -H "Accept: application/json" -u admin:admin http://127.0.0.1:8980/opennms/rest/alarms
These fail with empty bean exceptions:
curl -v -H "Accept: application/json" -u admin:admin http://127.0.0.1:8980/opennms/rest/graphs/fornode/1
curl -v -H "Accept: application/json" -u admin:admin http://127.0.0.1:8980/opennms/rest/ksc/0
And this one has slightly different output then seen on demo:
curl -v -H "Accept: application/json" -u admin:admin http://127.0.0.1:8980/opennms/rest/categories
This is not an exhaustive list, but it demonstrates some of the current problems.
In CXF, we're currently using Jackson as a JSON provider, whereas in Jersey we used a mapper that leveraged the existing JAXB annotations.
An attempt to use Jettison as a JSON provider in CXF fixed the exceptions and overflow errors, but produced different JSON output then what was previously rendered.