Upgrading from Wildfly-8.1.0.Final to Wildfly-17.0.1.Final
class Parent {
String prop1;
public Parent(String prop1) {
this.prop1 = prop1;
}
}
class Child extends Child {
String prop2;
public Child(String prop1, String prop2) {
super(prop1);
this.prop2 = prop2;
}
}
In Controller Layer
public Parent getDetails() {
return serviceImpl.getDetails();
}
In Service Layer
public Child getDetails() {
return new Child("String1", "String2");
}
From Wildfly 8, we are getting
{
"prop1": "String1",
"prop2": "String2"
}
But from Wildfly 17, we are getting
{
"prop1": "String1"
}
We thought it's maybe due to Jackson library, so we changed the jackson library version in pom.xml to 2.3.2 while running with Wildfly 17, but still it was coming in the same way
We tried with Jackson 2.9.8 with Wildfly 8 as well, but still WF8 returned both properties "prop1" and "prop2"
We are trying to find the root cause of this, does it have something related to internal implementation of WF17 or are we missing something else here ?
EDITED
We have tried one more thing : We tried to reproduce the issue with Jackson library on a standalone java code, and we are not able to reproduce this.
Although its still coming with Wildfly 8 or Wildfly 17 when ran with above Jackson 2.6.0 versions, till 2.5.5 this is not coming.
Issue Fixed: It was due to spring version that we were using, 4.2.0 (this version of spring does not support Jackson 2.6+ versions) That's why it was coming from Jackson 2.6.0.
It's a bug in spring fixed in Spring 4.2.1
https://github.com/spring-projects/spring-framework/issues/18008
https://jira.spring.io/browse/SPR-13429?redirect=false
Now its working with Spring 4.2.1 with Jackson 2.9.9 as well.