Am getting started with OpenMRS module development, and have a custom module am trying to get to successfully deploy in OpenMRS 2.4, however, after building the OMOD, I get the error here after attempting to load the module into the system via the module management interface.
I’ve tried to do some research, however, earlier hints were to explicitly add a Spring Core dependency to the module’s main pom file, which I did – check my updated project pom here, however, I still see errors relating to Spring classes not being found. What could be the issue here, and who has some hints on how to overcome this, please share.
Also, seeing as the original module dev hadn’t put any explicit Spring core dependencies in the module’s main pom, I wonder; given that OpenMRS bundles the spring framework, do modules leveraging spring feature need to explicitly reference it in their poms or not?
hello @nemesisfixx
In your logs i see
nested exception is java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver
do u mind adding AnnotationMethodHandlerExceptionResolver in your webModuleApplicationContext.xml and then build a new OMOD file, restart you server and trying deploying again
@nemesisfixx the AnnotationMethodHandlerExceptionResolver class was deprecated and eventually removed in Spring 5, which is the version of spring that OpenMRS platform 2.4 is using. Replace it with ExceptionHandlerExceptionResolver
@nemesisfixx you can look into your code where AnnotationMethodHandlerExceptionResolver is configured from and instead replace it with ExceptionHandlerExceptionResolver as @dkayiwa suggested
Worry not though, am picking up an alternate branch of this module and will re-try with that for alternate results. If stuck, perhaps I’ll call on you again Cliff or Kayiwa