Error comes up when I try to get data through the Resource URI

Hello everyone

This is the error which comes up when I try to retrieve data from table of my module using Resource URI

Please let me know how to resolve this issue.

Here’s the stack trace -

Hello Sharon,

OpenMRS has two getters as mentioned in the exception i.e. isRetired and getRetired, so Jackson can’t automatically convert the data into a JSON object as it gets confused with two getters.

The best bet is getting the object and converting it yourself like I’m trying to do here while trying to get a base openmrs object or if there is no preference there wont be any exception getting an XML.

– Maurya

Thanks @maurya , will try it :smile:

1 Like

This means that you are returning a raw OpenMRS object from a web service method. You need to be converting the object to a simpler representation.

1 Like

Thanks @darius will try resolving the issue :smile: