Spring Android - Deserializing JSON objects causing issues when there is inheritance
I am facing an issue with Deserializing a POJO object.

Following is the structure of the POJO objects on the Service side.

Class Ball{
int field1;
int field2;

}

Class BaseBall extends Ball
{
int field3;
int field4;
}

Class BallList{
List<Ball> balls;
}

Even on the Android Client side, i have a similar structure for the POJO objects.

Code for Android Client:
RestTemplate restTemplate = new RestTemplate();

List<MediaType> acceptableMediaTypes = new ArrayList<MediaType>();
acceptableMediaTypes.add(new MediaType("application","json"));

HttpHeaders headers = new HttpHeaders();
headers.setAccept(acceptableMediaTypes);

HttpEntity<String> entity = new HttpEntity<String>(headers);

ResponseEntity<BallList> response = restTemplate.exchange(
url,
HttpMethod.GET, entity, BallList.class);

if(response.getStatusCode() == HttpStatus.OK)
{
result += "OK";
}

04-13 18:17:46.127: ERROR/AndroidRuntime(4359): Caused by: org.springframework.web.client.ResourceAccessExcep tion: I/O error: Unrecognized field "filed3" (Class com.xx.yy.model.Ball), not marked as ignorable

On the service side, i am providing the baseball list as a response. Can anyone point me to a solution please. 
Spring Android - Deserializing JSON objects causing issues when there is inheritance
===

I am facing an issue with Deserializing a POJO object.

Following is the structure of the POJO objects on the Service side.

Class Ball{
int field1;
int field2;

}

Class BaseBall extends Ball
{
int field3;
int field4;
}

Class BallList{
List<Ball> balls;
}

Even on the Android Client side, i have a similar structure for the POJO objects.

Code for Android Client:
RestTemplate restTemplate = new RestTemplate();

List<MediaType> acceptableMediaTypes = new ArrayList<MediaType>();
acceptableMediaTypes.add(new MediaType("application","json"));

HttpHeaders headers = new HttpHeaders();
headers.setAccept(acceptableMediaTypes);

HttpEntity<String> entity = new HttpEntity<String>(headers);

ResponseEntity<BallList> response = restTemplate.exchange(
url,
HttpMethod.GET, entity, BallList.class);

if(response.getStatusCode() == HttpStatus.OK)
{
result += "OK";
}

04-13 18:17:46.127: ERROR/AndroidRuntime(4359): Caused by: org.springframework.web.client.ResourceAccessExcep tion: I/O error: Unrecognized field "filed3" (Class com.xx.yy.model.Ball), not marked as ignorable

On the service side, i am providing the baseball list as a response. Can anyone point me to a solution please. 