Getting error - Unable to load/find moduleActivator - in openmrs-insuranceclaims module

Hi @dkayiwa ,

I’ve tried to upgrade the openmrs-insuranceclaims-module from supporting dstu3 to r4 and when I’m trying to start it with bahmni openmrs 2.5.12 it is giving this error -

WARN - ModuleFactory.stopModule(1165) |2023-10-09T09:04:20,401| Unable to call module's Activator.shutdown() method
org.openmrs.module.ModuleException: Unable to load/find moduleActivator: 'org.openmrs.module.insuranceclaims.InsuranceClaimsActivator' Module: Insurance Claims
        at org.openmrs.module.Module.getModuleActivator(Module.java:164) ~[openmrs-api-2.5.12.jar:?]
        at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1160) ~[openmrs-api-2.5.12.jar:?]
        at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:794) ~[openmrs-api-2.5.12.jar:?]
        at org.openmrs.api.context.Daemon$1.run(Daemon.java:86) ~[openmrs-api-2.5.12.jar:?]
Caused by: java.lang.NoClassDefFoundError: org/openmrs/event/EventListener
        at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_372]
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2699) ~[?:1.8.0_372]
        at java.lang.Class.getConstructor0(Class.java:3103) ~[?:1.8.0_372]
        at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_372]
        at org.openmrs.module.Module.getModuleActivator(Module.java:155) ~[openmrs-api-2.5.12.jar:?]
        ... 3 more
Caused by: java.lang.ClassNotFoundException: org.openmrs.event.EventListener
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1420) ~[catalina.jar:8.5.88]
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1228) ~[catalina.jar:8.5.88]
        at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:564) ~[openmrs-api-2.5.12.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_372]
        at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_372]
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2699) ~[?:1.8.0_372]
        at java.lang.Class.getConstructor0(Class.java:3103) ~[?:1.8.0_372]
        at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_372]
        at org.openmrs.module.Module.getModuleActivator(Module.java:155) ~[openmrs-api-2.5.12.jar:?]
        ... 3 more

How can I resolve this error? Changes done for R4 are available here - GitHub - chughrahul/openmrs-module-insuranceclaims-R4

Can you add the event module do the list of required modules? https://github.com/chughrahul/openmrs-module-insuranceclaims-R4/blob/main/omod/src/main/resources/config.xml#L22

Hi @dkayiwa ,

Thank you for the response. I’ll try it and let you know the status.

Also, I was trying to add a class to my module that I run with openmrs. My module works fine with openmrs but as soon as I add this dependency -

 <dependency>
      <groupId>io.hcxprotocol</groupId>
      <artifactId>hcx-integrator-sdk</artifactId>
      <version>1.0.5</version>
  </dependency>

, openmrs doesn’t startup and give the following error -

Do I need to change anything or any other suggestions if you can provide to solve this?

A screenshot of the the error message is not as helpful as a the full server side log via pastebin.com

Hi @dkayiwa ,

Here is the complete error I’m getting - ERROR - FrameworkServlet.initServletBean(534) |2023-10-17T05:51:37,551| Context - Pastebin.com

Are you trying to run this in bahmni?

Yes with Bahmni Openmrs 2.5.10.

Hi @dkayiwa

Is there any possible solution for this issue?

How did you set this up? Did you just add bahmnicore to the 2.x OpenMRS Reference Application? Or did you do a full normal bahmni setup?

@dkayiwa I’ve a docker compose setup of bahmni standard which is currently running on openmrs 2.5.10. And I’ve my additional module which runs fine on plain openmrs as well as bahmni-openmrs.

But as soon as I add this class, bahmni-openmrs is giving this error. However, it still runs fine with the plain openmrs.

Class I’m adding -

 <dependency>
      <groupId>io.hcxprotocol</groupId>
      <artifactId>hcx-integrator-sdk</artifactId>
      <version>1.0.5</version>
 </dependency>

Error logs - ERROR - FrameworkServlet.initServletBean(534) |2023-10-17T05:51:37,551| Context - Pastebin.com

Try using the latest Bahmni Standard docker-compose setup. It runs on openmrs 2.5.12, and packages some more modules, including openmrs events module

Hi @gsluthra @dkayiwa

I tried it with 2.5.12 but it is giving the same error. ERROR - FrameworkServlet.initServletBean(534) |2023-10-19T17:04:03,896| Context - Pastebin.com

Also, the modules that it loaded are -

addresshierarchy-2.14.2.omod    emrapi-1.32.0.omod                  metadatamapping-1.5.0.omod                    reporting-1.23.0.omod
appframework-2.16.0.omod        episodes-1.1.0.omod                 metadatasharing-1.8.0.omod                    reportingrest-1.12.0.omod
appointments-1.7.0.omod         event-2.10.0.omod                   openconceptlab-2.1.0.omod                     rulesengine-1.0.0.omod
auditlog-1.3.0.omod             fhir2-1.10.0-SNAPSHOT.omod          openelis-atomfeed-client-1.2.0-SNAPSHOT.omod  serialization.xstream-0.2.15.omod
bacteriology-1.3.0.omod         fhir2Extension-1.3.0-SNAPSHOT.omod  openmrs-atomfeed-2.6.2.omod                   teleconsultation-1.1.0.omod
bahmni-commons-1.0.0.omod       hipmodule-omod-0.1-SNAPSHOT.omod    operationtheater-1.7.0.omod                   uicommons-2.19.0.omod
bahmni.ie.apps-1.3.0raxa.omod   htmlwidgets-1.10.0.omod             owa-1.13.0.omod                               uiframework-3.22.0.omod
bahmnicore-1.2.0-SNAPSHOT.omod  idgen-4.7.0.omod                    pacsquery-1.4.0.omod                          uilibrary-2.0.7.omod
bedmanagement-5.13.0.omod       idgen-webservices-1.4.0.omod        providermanagement-2.13.0.omod                webservices.rest-2.39.0.omod
calculation-1.3.0.omod          initializer-2.4.0.omod              raxacore-2.6.0.omod
communication-1.1.0.omod        legacyui-1.13.0.omod                reference-data-1.2.0-SNAPSHOT.omod

Hi @gsluthra @dkayiwa

Is there any possible solution for this problem that I can try?

Can you check the modules listed here, in latest bahmni-standard, to see if they match what you see: https://docker.standard.mybahmni.in/openmrs

(note: Environment is down due to some issue. Should be up and running in a few hours. @rahu1ramesh and Anubhav are investigating)

The dev environments are back online, and are now accessible through the following URLs:

  1. https://dev-lite.mybahmni.in/
  2. https://dev.lite.mybahmni.in/
  3. https://docker.standard.mybahmni.in/
1 Like

Thanks @rahu1ramesh

@chughrahul : Can you check if your module versions match the latest in Bahmni standard here: https://docker.standard.mybahmni.in/openmrs/admin/modules/module.list

We don’t ship the insurance module right now, so can’t comment on its dependencies. That will need further analysis to check which dependencies are not resolving / incompatible.

Hi @dkayiwa @gsluthra

I found the root cause of the problem. The problem is fhir2 module is imported in my module which is internally using hapi fhir 5.4.0 but the dependency above is using hapi fhir 6.0.3 version.

I tried excluding the hapi-fhir-base from the fhir2 dependency imported in my module but when I’m doing that openmrs is not getting started.

@chughrahul

  • Are you able to start your module (with additional dependency of hcx-integrator-sdk) without fhir2-1.10.0-SNAPSHOT.omod, fhir2Extension-1.3.0-SNAPSHOT.omod in Bahmni-Standard ?
  • Do you have any other custom module(s) apart for default Bahmni Standard modules ?
  • Do you have code checked in to git or somewhere ? If yes, provide steps to reproduce the issue.

cc @gsluthra

Hi @gsluthra @dkayiwa @sivareddy

I’m not able to start the module even after removing fhir2 modules in bahmni standard. I’ve a custom module that works fine with bahmni standard withput the hcx dependency. But due to the latest fhir versions used in this dependency (6.0.3), it is giving multiple errors.

you can’t use this dependency with Bahmni-standard which runs on JRE 8. minimum JRE to run this dependency is 11 (see this)

Are you able to build custom module successfully with hcx dependency (with JDK 8)?

Are you using any of the classes from this dependency in the custom module ?