While saving Observation with Boolean Concept using REST APIs exception is thrown. We are using OpenMRS 1.9.2 and Web Rest Service 1.2
Based on the ticket RESTWS-529, I have applied patch provided by @dkayiwa for Saving Boolean values
Interestingly, After applying the patch I can save only True values and when Observation has False value, I get an Exception Full Back trace
LazyInitializationException: failed to lazily initialize a collection of role: org.openmrs.Concept.names
Observation is getting saved in Database but while converting the response object to JSON above exception is thrown and client receives 500 Internal Server Error message.
With the above test case I can reproduce same LazyInitializationException.
From what I have debugged webservices module, Obs gets saved with true/false values, but problem arises when saved Observation object is converted to JSON String.
LazyInitialization Exception is thrown when Object is converted to Default Representation. Backtrace of crash when I run test case in ObsResource1_9Test.java
Meanwhile, I am trying to find out how to POST a request from Unit Test case.
I was able to create TestCase with POST messages Here is the patch with test cases.
Interestingly, Now Exception is not thrown while conversion of Obs to Default Representation. Can I assume that there is some problem with my installation and version of WebServices module ?
If that is the case Could you please give me some pointers to find out where the issue is in my version ?
Just for troubleshooting purposes, are you able to reproduce it if you replaced your module version with the latest release of the rest webservices module>
Yes I tried to replace our version with latest version of webservices module. But I get the following error.
Error while trying to start module
Module requires at least version 1.9.10, Current code version is only 1.9.2.0
** org.openmrs.module.ModuleUtil.checkRequiredVersion(ModuleUtil.java:328)
** org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:487)
** org.openmrs.api.context.Daemon$1.run(Daemon.java:57)
Is it possible to get this working with 1.9.2 version ?