We have recently upgraded our jBoss EAP from 6.2 to 7.3.0.
After the upgrade we have observed that the application started behaving weirdly. We are using spring framework version - 4.1.9.RELEASE.
For example:
@RestController
public class CommonController{
@RequestMapping(value = "/rest/report/testResponse", method = RequestMethod.GET)
public @ResponseBody List<Entry<String, Number>> getData(){
List<Entry<String, Number>> technologyList = new ArrayList<>();
SimpleEntry<String, Number> simpleEntry1 = new AbstractMap.SimpleEntry<String,Number>("Java",1);
SimpleEntry<String, Number> simpleEntry2 = new AbstractMap.SimpleEntry<String,Number>("Spring",2);
technologyList.add(simpleEntry1);
technologyList.add(simpleEntry2);
return technologyList;
}
}
The response I am getting when application was deployed in jBoss 6.2 is:
[
{
"key": "Java",
"value": 1
},
{
"key": "Spring",
"value": 2
}
]
The response I am getting when application is now deployed in jBoss 7.3 is:
[
{
"Java": 1
},
{
"Spring": 2
}
]
As you can see there is a subtle difference in above two responses. This is breaking my frontend code where we have used javascript code like below, since now in jBoss7 we are not getting response with key/value prepended :
<ui-select-choices repeat="obj.value as obj in technologyList | orderBy:'key'">
<div class ="small" ng-bind-html="obj.key" title ="{{obj.key}}"></div>
</ui-select-choices>
We can not modify the backend/frontend code because the application is already running in production and it will not be possible to change the code at many places. We just want to upgrade the jBoss version.
Anyone faced the similar issue, please comment/suggest the resolution.
Map.Entry
to{[key]: [value]}
instead of{"key": [key], "value": [value]}
– Fibrejackson-databind
version to the one used previously, then you can maybe stay on jboss 7 – Fibre