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

Classloading issues on OpenMRS installation and DB Upgrades

    XMLWordPrintable

    Details

    • Complexity:
      Low
    • Development:

      Description

      In OpenMRS, there is 3 places where the webapp and spring web application context are initialized i.e. the web Listener, InitializationFilter and UpdateFilter. You can't load module resources on OpenMRS installation or Upgrade unless you explicitly use the OpenMRS classloader, this can lead to obscure bugs unknowingly. Both the listener and the filters start OpenMRS in a daemon thread but the filters spawn the daemon thread before setting the OpenMRS classloader instance on the current thread which is the reason why module resources can't be loaded during initialization and upgrade. In theory bugs caused by this only show up after installation and upgrade but on subsequent restarts of OpenMRS they go away.

      Proposed Solution:

      • Update the filters to set the Openmrs classloader on the current thread before starting OpenMRS and the spring web application context that way it is inherited by the daemon thread.
         

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              gcliff CLIFF GITA
              Reporter:
              wyclif Wyclif Luyima
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: