I’m using reference app 12.2, posting new encounters for the first time. Whenever there is a validation error, OpenMRS just returns a very cryptic message like:
Request processing failed; nested exception is org.openmrs.module.webservices.rest.web.response.ConversionException: observations on class org.openmrs.Encounter
or
… the same ConversionException with: encounterDatetime on class org.openmrs.Encounter
So, after trial and error on the 2nd one, it seems OpenMRS doesn’t like microseconds in the date format. I’m still trying to figure out what is wrong with the 1st one, the observations in the encounter, since the error message is of no help. Also nothing in the logs.
Can this error reporting be improved, it’s hard to make progress at the moment?
Another case of deficient error reporting for encounter/observation:
The obs has value=6, for a ConceptNumeric with low_absolute=0, hi_absolute=5.
In the OpenMRS log, I can see the correct error:
org.openmrs.api.ValidationException: 'obs id is null' failed to validate with reason: valueNumeric: error.outOfRange.high
However, the exception that is returned to the caller is 100% unusable. It looks like an exception in the exception handler, so the message is unusable:
No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.openmrs.api.ValidationException['errors']->org.springframework.validation.BindException['bindingResult']->org.springframework.validation.BeanPropertyBindingResult['messageCodesResolver'])
Thanks @dkayiwa, I saw on JIRA RESTWS-899 that at least one error was fixed. My Rest Web Services OMOD version is 2.32.0.68810c, running under ref app 2.12. How do I upgrade to 2.34?
I have upgraded the module to 2.36, but now I have database compatibility issues. I guess there are Liquibase changesets to run to migrate 2.32 to 2.36? What is the recommended way of doing this ? Can I get the list of changeset XML files somewhere?
Yeah, I also found it strange that the REST API would require db changes. I sort of assumed that the newer version of the REST API triggered different code paths in OpenMRS core, and that those paths required db updates.
Unfortunately, I have reverted to version 2.32 because of the errors I was seeing, and I didn’t record the exact error message. It was along the lines of not finding some lookup value with name “ZZ”. I then looked for any reference to “ZZ” in the Liquibase snapshots from my reference application, and found column concept_datatype.hl7_abbreviation assigned that value, so I assumed it had something to do with changesets. I might be wrong, though…