Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-6046

Failing to load advice should not mess up startup

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • Core 2.5.0
    • None
    • None

    Description

      When OpenMRS fails to load a module advice because of a NoClassDefFoundError, the startup process is messed up in such a way that some of the functionality no longer works. For instance, one is not able to log in via the loginServlet of the legacyui module. This happened when i changed the bahmni appointment module from require to aware of the atomfeed module, resulting into this error on startup:

      java.lang.NoClassDefFoundError: org/ict4h/atomfeed/jdbc/JdbcConnectionProvider
      	at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_152]
      	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[?:1.8.0_152]
      	at java.lang.Class.getConstructor0(Class.java:3075) ~[?:1.8.0_152]
      	at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_152]
      	at org.openmrs.module.AdvicePoint.getClassInstance(AdvicePoint.java:61) ~[openmrs-api-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.module.ModuleFactory.loadAdvice(ModuleFactory.java:882) [openmrs-api-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:913) [openmrs-api-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:844) [openmrs-web-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:611) [openmrs-web-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:591) [openmrs-web-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.web.Listener.startOpenmrs(Listener.java:259) [openmrs-web-2.6.0-SNAPSHOT.jar:?]
      	at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42) [openmrs-web-2.6.0-SNAPSHOT.jar:?]
      Caused by: java.lang.ClassNotFoundException: org.ict4h.atomfeed.jdbc.JdbcConnectionProvider
      	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1407) ~[tomcat-catalina-9.0.54.jar:9.0.54]
      	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1215) ~[tomcat-catalina-9.0.54.jar:9.0.54]
      	at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:564) ~[openmrs-api-2.6.0-SNAPSHOT.jar:?]
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_152]
      

      because of failing to load these: https://github.com/Bahmni/openmrs-module-appointments/blob/v1.3.0/omod/src/main/resources/config.xml#L46-L59 which depend on the atomfeed module via their base class https://github.com/Bahmni/openmrs-module-appointments/blob/v1.3.0/api/src/main/java/org/openmrs/module/appointments/advice/AbstractBaseAdvice.java

      https://bahmni.atlassian.net/browse/AP-12

      Gliffy Diagrams

        Attachments

          Activity

            People

              dkayiwa Daniel Kayiwa
              dkayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: