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

A module's failing to start should not prevent other modules from starting

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Platform 2.0.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      When a module fails to start, the platform does not start any other modules. To reproduce this, just drop simplelabentry-1.8.omod into the modules folder and start the platform. It took me a while to figure out that this was the cause because the error message did not tell which module actually failed.
      The error in the logs was as below:

      Exception in thread "Thread-24" java.lang.NoClassDefFoundError: org/openmrs/module/Activator
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      	at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:637)
      	at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:556)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.openmrs.module.Module.getModuleActivator(Module.java:155)
      	at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:814)
      	at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:866)
      	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:643)
      	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:622)
      	at org.openmrs.web.Listener.startOpenmrs(Listener.java:260)
      	at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
      Caused by: java.lang.ClassNotFoundException: org.openmrs.module.Activator
      	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
      	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
      	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:470)
      	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:421)
      	at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:563)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 19 more
      

      The correct behavior should be that other modules are started apart from only the failing ones. That way, the end user can start the legacyui module and see which module failed to start using the modules page.

        Attachments

          Activity

            People

            • Assignee:
              dkayiwa Daniel Kayiwa
              Reporter:
              dkayiwa Daniel Kayiwa
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: