Bring-in OpenMRS Platform changes to Reference Application modules

I’ve made a few changes to the api and web modules of openmrs-core project (Platform 1.11.4) and have successfully generated api, web, test jars along with platform war. I’m trying to bring-in these changes to reference application modules like coreapps, emrapi, registrationcore, etc. All the reference application modules are accessing openmrs-api and other dependent modules using maven dependencies extracting jars from OpenMRS Nexus Repository.To bring-in the platform changes I’ve replaced the above dependencies with the jars generated after building the platform locally. Having done the above I’ve built the modules with changes so as to generate corresponding omod files.

Issue: I’m unable to deploy the module (omod files) to an existing OpenMRS instance. On deploying the WAR in tomcat a bunch of exceptions are raised leading to startup failure.

Error log:

ERROR - Listener.performWebStartOfModules(643) |2015-12-29 16:47:17,929| Unable to refresh the spring application context.  Root Cause was:
org.springframework.beans.FatalBeanException: Class [org.springframework.context.config.ContextNamespaceHandler] for namespace [http://www.springframework.org/schema/context] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:126)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1433)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:814)
at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:962)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:630)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:609)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:252)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - Listener.performWebStartOfModules(672) |2015-12-29 16:47:17,958| caught another error:
org.openmrs.api.APIException: Service not found: interface org.openmrs.scheduler.SchedulerService
at org.openmrs.api.context.ServiceContext.getService(ServiceContext.java:728)
at org.openmrs.api.context.ServiceContext.getSchedulerService(ServiceContext.java:283)
at org.openmrs.api.context.Context.getSchedulerService(Context.java:485)
at org.openmrs.module.web.WebModuleUtil.stopTasks(WebModuleUtil.java:382)
at org.openmrs.module.web.WebModuleUtil.stopModule(WebModuleUtil.java:861)
at org.openmrs.module.web.WebModuleUtil.shutdownModules(WebModuleUtil.java:804)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:649)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:609)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:252)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,960|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\formentryapp\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,961|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\formentryapp
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,964|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\registrationapp\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,965|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\registrationapp
WARN - ModuleFactory.stopModule(1203) |2015-12-29 16:47:17,968| Unable to call module's Activator.shutdown() method
org.openmrs.api.APIException: Service not found: interface org.openmrs.module.appframework.service.AppFrameworkService
at org.openmrs.api.context.ServiceContext.getService(ServiceContext.java:728)
at org.openmrs.api.context.Context.getService(Context.java:930)
at org.openmrs.module.referenceapplication.ReferenceApplicationActivator.stopped(ReferenceApplicationActivator.java:230)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1198)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1121)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1121)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1121)
at org.openmrs.module.ModuleUtil.shutdown(ModuleUtil.java:143)
at org.openmrs.api.context.Context.shutdown(Context.java:898)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:258)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,970|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\referenceapplication\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,974|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\referenceapplication
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,976|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlformentryui\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,978|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlformentryui
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,981|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\referencedemodata
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,982|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\referencemetadata\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,984|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\referencemetadata
WARN - ModuleFactory.stopModule(1203) |2015-12-29 16:47:17,987| Unable to call module's Activator.shutdown() method
org.openmrs.api.APIException: Service not found: interface org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService
at org.openmrs.api.context.ServiceContext.getService(ServiceContext.java:728)
at org.openmrs.api.context.Context.getService(Context.java:930)
at org.openmrs.module.appointmentschedulingui.AppointmentSchedulingUIActivator.removeDataSetDefinitions(AppointmentSchedulingUIActivator.java:107)
at org.openmrs.module.appointmentschedulingui.AppointmentSchedulingUIActivator.stopped(AppointmentSchedulingUIActivator.java:95)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1198)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1121)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1121)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1121)
at org.openmrs.module.ModuleUtil.shutdown(ModuleUtil.java:143)
at org.openmrs.api.context.Context.shutdown(Context.java:898)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:258)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,989|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appointmentschedulingui\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,993|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appointmentschedulingui
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:17,999|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\coreapps\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:18,005|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\coreapps
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,320|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\emrapi\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,323|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\emrapi
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,327|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\metadatadeploy\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,328|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\metadatadeploy
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,334|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\metadatasharing\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,335|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\metadatasharing
WARN - ModuleFactory.stopModule(1097) |2015-12-29 16:47:53,340| Unable to call module's Activator.willStop() method
java.lang.NullPointerException
at org.openmrs.api.context.ServiceContext.getRegisteredComponents(ServiceContext.java:959)
at org.openmrs.api.context.ServiceContext.getRegisteredComponents(ServiceContext.java:923)
at org.openmrs.api.context.Context.getRegisteredComponents(Context.java:1230)
at org.openmrs.module.reporting.ReportingModuleActivator.cancelAllScheduledTasks(ReportingModuleActivator.java:65)
at org.openmrs.module.reporting.ReportingModuleActivator.willStop(ReportingModuleActivator.java:47)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1094)
at org.openmrs.module.ModuleUtil.shutdown(ModuleUtil.java:143)
at org.openmrs.api.context.Context.shutdown(Context.java:898)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:258)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,349|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\reportingrest\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,350|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\reportingrest
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,351|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appointmentscheduling\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,357|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appointmentscheduling
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,364|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\reporting\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,366|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\reporting
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,370|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\registrationcore\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,372|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\registrationcore
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,377|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\idgen\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,378|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\idgen
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,383|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\allergyui\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,384|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\allergyui
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,391|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\adminui\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,392|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\adminui
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,397|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appui\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,398|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appui
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,404|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appframework\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,405|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\appframework
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,411|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\metadatamapping\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,413|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\metadatamapping
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,418|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\providermanagement\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,419|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\providermanagement
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,425|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\uicommons\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,426|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\uicommons
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,431|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\uilibrary\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,433|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\uilibrary
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,438|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\uiframework\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,439|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\uiframework
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,446|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlwidgets\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,447|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlwidgets
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,452|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\serialization.xstream\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,453|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\serialization.xstream
WARN - ModuleFactory.stopModule(1203) |2015-12-29 16:47:53,458| Unable to call module's Activator.shutdown() method
org.openmrs.api.APIException: Service not found: interface org.openmrs.module.htmlformentry.HtmlFormEntryService
at org.openmrs.api.context.ServiceContext.getService(ServiceContext.java:728)
at org.openmrs.api.context.Context.getService(Context.java:930)
at org.openmrs.module.htmlformentry19ext.HTMLFormEntryExtensions19Activator.stopped(HTMLFormEntryExtensions19Activator.java:43)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1198)
at org.openmrs.module.ModuleUtil.shutdown(ModuleUtil.java:143)
at org.openmrs.api.context.Context.shutdown(Context.java:898)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:258)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,460|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlformentry19ext\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,468|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlformentry19ext
WARN - ModuleFactory.stopModule(1203) |2015-12-29 16:47:53,472| Unable to call module's Activator.shutdown() method
java.lang.NullPointerException
at org.openmrs.api.context.ServiceContext.getRegisteredComponents(ServiceContext.java:959)
at org.openmrs.api.context.ServiceContext.getRegisteredComponents(ServiceContext.java:923)
at org.openmrs.api.context.Context.getRegisteredComponents(Context.java:1230)
at org.openmrs.util.HandlerUtil.getHandlersForType(HandlerUtil.java:116)
at org.openmrs.module.event.EventActivator.stopped(EventActivator.java:89)
at org.openmrs.module.ModuleFactory.stopModule(ModuleFactory.java:1198)
at org.openmrs.module.ModuleUtil.shutdown(ModuleUtil.java:143)
at org.openmrs.api.context.Context.shutdown(Context.java:898)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:258)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,477|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\event\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,488|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\event
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,489|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\calculation\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,491|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\calculation
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,497|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\allergyapi\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,498|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\allergyapi
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,504|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlformentry\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,565|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\htmlformentry
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,566|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\webservices.rest\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,567|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\webservices.rest
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,572|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\dataexchange\lib
WARN - OpenmrsUtil.deleteDirectory(1112) |2015-12-29 16:47:53,578|    ...could not remove directory: E:\apache-tomcat-8.0.23\temp\1451387808663.openmrs-lib-cache\dataexchange
INFO - HibernateContextDAO.showUsageStatistics(359) |2015-12-29 16:47:53,579| QUERY: from Role r order by r.role
INFO - HibernateContextDAO.showUsageStatistics(361) |2015-12-29 16:47:53,580| Cache Hit Count : 0
INFO - HibernateContextDAO.showUsageStatistics(362) |2015-12-29 16:47:53,585| Cache Miss Count: 0
INFO - HibernateContextDAO.showUsageStatistics(363) |2015-12-29 16:47:53,585| Cache Put Count : 0
INFO - HibernateContextDAO.showUsageStatistics(364) |2015-12-29 16:47:53,592| Execution Count : 19
INFO - HibernateContextDAO.showUsageStatistics(365) |2015-12-29 16:47:53,592| Average time    : 59
INFO - HibernateContextDAO.showUsageStatistics(366) |2015-12-29 16:47:53,598| Row Count       : 608
INFO - HibernateContextDAO.showUsageStatistics(359) |2015-12-29 16:47:53,599| QUERY: from Privilege p order by p.privilege
INFO - HibernateContextDAO.showUsageStatistics(361) |2015-12-29 16:47:53,604| Cache Hit Count : 0
INFO - HibernateContextDAO.showUsageStatistics(362) |2015-12-29 16:47:53,605| Cache Miss Count: 0
INFO - HibernateContextDAO.showUsageStatistics(363) |2015-12-29 16:47:53,611| Cache Put Count : 0
INFO - HibernateContextDAO.showUsageStatistics(364) |2015-12-29 16:47:53,611| Execution Count : 19
INFO - HibernateContextDAO.showUsageStatistics(365) |2015-12-29 16:47:53,617| Average time    : 1
INFO - HibernateContextDAO.showUsageStatistics(366) |2015-12-29 16:47:53,617| Row Count       : 5263
INFO - HibernateContextDAO.showUsageStatistics(359) |2015-12-29 16:47:53,622| QUERY: from User u where u.uuid = :uuid
INFO - HibernateContextDAO.showUsageStatistics(361) |2015-12-29 16:47:53,623| Cache Hit Count : 0
INFO - HibernateContextDAO.showUsageStatistics(362) |2015-12-29 16:47:53,629| Cache Miss Count: 0
INFO - HibernateContextDAO.showUsageStatistics(363) |2015-12-29 16:47:53,630| Cache Put Count : 0
INFO - HibernateContextDAO.showUsageStatistics(364) |2015-12-29 16:47:53,635| Execution Count : 489
INFO - HibernateContextDAO.showUsageStatistics(365) |2015-12-29 16:47:53,636| Average time    : 0
INFO - HibernateContextDAO.showUsageStatistics(366) |2015-12-29 16:47:53,643| Row Count       : 489
ERROR - Listener.contextInitialized(188) |2015-12-29 16:47:53,660| Got exception while starting up:
org.openmrs.module.ModuleException: Unable to start OpenMRS. Error thrown was: org.openmrs.api.APIException: Service not found: interface org.openmrs.scheduler.SchedulerService
at org.openmrs.web.WebDaemon.startOpenmrs(WebDaemon.java:65)
at org.openmrs.web.Listener.contextInitialized(Listener.java:180)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.servlet.ServletException: org.openmrs.api.APIException: Service not found: interface org.openmrs.scheduler.SchedulerService
at org.openmrs.web.Listener.startOpenmrs(Listener.java:260)
at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
Caused by: org.openmrs.api.APIException: Service not found: interface org.openmrs.scheduler.SchedulerService
at org.openmrs.api.context.ServiceContext.getService(ServiceContext.java:728)
at org.openmrs.api.context.ServiceContext.getSchedulerService(ServiceContext.java:283)
at org.openmrs.api.context.Context.getSchedulerService(Context.java:485)
at org.openmrs.module.web.WebModuleUtil.stopTasks(WebModuleUtil.java:382)
at org.openmrs.module.web.WebModuleUtil.stopModule(WebModuleUtil.java:861)
at org.openmrs.module.web.WebModuleUtil.shutdownModules(WebModuleUtil.java:804)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:649)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:609)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:252)
... 1 more
WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2669) |2015-12-29 16:47:53,748| Unable to find a runtime properties file at E:\apache-tomcat-8.0.23\bin\openmrs-runtime.properties
29-Dec-2015 16:47:54.112 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive E:\apache-tomcat-8.0.23\webapps\openmrs.war has finished in 80,315 ms
29-Dec-2015 16:47:54.115 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
29-Dec-2015 16:47:54.122 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
29-Dec-2015 16:47:54.122 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 80375 ms

Do yo have multiple versions of Spring by any chance ?

No. I’ve all the artifacts from Spring having version same as the one in Platform 1.11.4 i.e. 3.2.7.RELEASE.

What kind of changes have you made to the platform? Are they committed somewhere?

I have introduced few model classes and corresponding service layer entities (DAO, DAOImpl, Service, ServiceImpl). I haven’t commited these changes anywhere on the cloud.

The platform changes are not messing up things somehow because I’m able to deploy modified version of platform along with original Reference Application 2.3 modules without running into any errors.

I’m a little confused by what you’re are trying to achieve, have you forked core and the modules so as to introduce your own changes or are you working on reference application tickets? If you’re are working on ref app tickets, just make sure you have pulled the latest module changes and the 1.11.x master branch for core because everything should be working fine as seen here https://ci.openmrs.org/browse/REFAPP-OMODDISTRO/latest since the build is green unless your changes have issues which you need to figure out. If you’re introducing some custom features to core or any of the modules, how are you doing it? Have you forked them? If yes, i think it might be not quite the right route you would want to take. It would be best to suggest them so that they get added to our ref app road map or do them in your own custom modules.

I’ve using OpenMRS platform 1.11.4 release and the latest releases of various modules from reference application 2.3.1. I’m working on multi-tenancy. I’ve introduced few models and their corresponding service layer classes & interfaces. To bring-in the changes made to the platform code I’ve imported the platform jars(openmrs-api, openmrs-api-test, openmrs-web, openmrs-web-test) to the modules instead of using jars from OpenMRS Nexus Repository. Also I’ve added few lines of code in some of the reference application modules like coreapps, emrapi, registrationcore, etc.

I’m able to build the platform code as well as the modules but face the issue when I place the modules in ~/OpenMRS/modules directory and deploy the application via tomcat.

Without looking at the changes you have put in the modules and platform, am out of ideas! :smile:

Does everything run fine without your changes?

No. Things doesn’t work well even if I undo my changes -> build modules and redeploy the application. By undo I mean only the code changes. Rest of the things like pom and reference to local jar files (openmrs-api, openmrs-api-test, openmrs-web, openmrs-web-test) is still intact.

But, when the application is deployed along with the original modules obtained as a part of Reference Application 2.3.1 (36 of them) it works without running into any issues.

One more thing I would like to bring to your notice is that when I change these OpenMRS core pom dependencies to take up system jars, I’m forced to define junit, commons, hibernate, and spring-related dependencies.

Note that downloading the ref app modules isn’t the same as running your own local builds of the modules even if you have made no local changes unless the builds are off the tags matching the released versions of the modules. There is always ongoing development in the master branches of several ref app modules so things change all the time. My suggestion is start with a working copy of downloaded modules, and change one at a time to local build. E.g if you wish to make a change to coreapps module, checkout the module’s latest code from github and look at its pom file and check if you need to do the same for any module it depends on but some module pull their dependencies from the distro project so this might not always apply, personally instead of this. In a dev environment, i look at the pom file for the distro project to know which module versions i need to have installed as long as its CI plan is green.

@wyclif I’ve got the latest release of each of the reference application modules (coreapps, emrapi, etc.). The modules when built without making changes to the code or pom integrates with the platform without any issues (Build -> place omod files in modules directory -> deploy platform WAR in tomcat).

The thing is I haven’t explained my problem quite clearly to you guys. My apologies. Let me keep things simple and straightforward. I follow the below mentioned cycle for all modules:

  • I’ve got the latest release of a module (say emrapi).
  • Now, I build the module to obtain corresponding omod file.
  • After that I place the omod file to ~/OpenMRS/modules directory and successfully deploy the application without any exceptions
  • Now, I want my custom platform-api logic to be used inside emrapi module.
  • In order to do so, I’ve modified the pom dependencies in emrapi module like openmrs-api and other core dependencies to take up local system jar obtained by building the platform with custom implementation instead of obtaining the jar from OpenMRS nexus repository.
  • By making the above pom changes I get package import issues forcing me to define few more pom dependencies like - springframework, junit, hamcrest, commons, etc.
  • Finally, I’m able to build module to generate omod file
  • Now, I place the omod file to ~/OpenMRS/modules directory (removing original emrapi omod file) and deploy the application. I get a bunch of exceptions related to ‘Service Startup failure’ and few others.

I don’t know if I’m doing things in a correct manner.:sweat:

Hello @wyclif. It highly seems to be the issue with the additional dependencies I’m forced to add to pom files in modules when I configure the pom to take on the local jars instead of nexus repository jars.

I’ve compared the jars obtained from nexus repository and the one generated on building the platform locally. They’re almost identical in size and content. I do not simply understand why I’m required to add spring and other related dependencies when I replace a jar with another identical jar (except for platform changes I’ve made).

I’m still confused by what you’re doing, why do you have to make changes to the platform? Are you just trying playing around with the code or something? Can you share where your code resides so that we can take a look at the pom files? And as i mentioned earlier, if you want to change to a snapshot version of a module for you to do some work, you need to verify that you’re are running the correct versions of the modules it depends on because these could have changed since the last release of the ref app.

Thanks @lluismf, @wyclif and @dkayiwa for posting. I’ve resolved the above issue and can deploy the modules on running platform without any exceptions.

Cause of the Issue: As I mentioned when I replaced the OpenMRS core dependencies (api, api-test, web, web-test, test) with the local jar file from platform build, I was forced to include various dependencies like (springframework dependencies, junit, hibernate, etc) due to missing package errors. These jars were getting packaged with module’s omod file causing the omod file to grow like 10 times. On deployment module jars conflicted with the platform jars and caused the application to crash with service startup and log appender related exceptions.

Solution: Change the scope of all the additional dependencies added later to <scope>provided</scope> so as to exclude those jars from being packaged along with the module’s omod file.

1 Like