[http-nio-8080-exec-4] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/openmrs].[openmrs]- Servlet.service() for servlet [openmrs] in context with path [/openmrs] threw exception [Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.openmrs.module.webservices.rest.SimpleObject.get(Ljava/lang/String;)Ljava/lang/Object;] with root cause
java.lang.NoSuchMethodError: org.openmrs.module.webservices.rest.SimpleObject.get(Ljava/lang/String;)Ljava/lang/Object;
Exceptions started coming up on December 14, and consistenly happening on all our machines. None of the emrapi code was changed - this was working for us before December 14th, and stopped on that date.
Issue is very strange because in general a method that expects an Object can be called with String without explicitly casting as Object, since String is Object
If String is cast to Object and the method is called, it works fine.
We have tried building older versions, but on any build post Dec 14th, we are facing the issue
This is normal behavior and caused by the fact that you compiled your emrapi module against a version of the rest web services module that had a SimpleObject.get(Ljava/lang/String;) that expects a string parameter. But at runtime, that method is not found.
So you have two option to fix this:
Either deploy the rest webservices module that has this SimpleObject.get(Ljava/lang/String;) that expects a string parameter.
Or recompile the emrapi module with a version of the rest web services module that does not have this get method which expects a string parameter.
Thanks a lot for your replies @dkayiwa@raff and @lluismf, it helped understanding the issue at hand.
Unfortunately we cannot move to webservices.rest 2.13-SNAPSHOT just as yet. And as mentioned, @lluismf’s change is fine as it is, we have already forked the omod to add the same method. We will be working towards depending on a version and not a spanshot in the coming weeks.