Installing the Legacy UI module on platform 2.0.0 Beta

I am currently running openMRS version 2.0.0 beta and was trying to install the latest version of Legacy UI module 0.3 by following the tutorial: https://wiki.openmrs.org/display/docs/User+Interface+Modules

I tried both versions (Implementers by copying omod file and developers by cloning the github repository, building it and then copying the omod file) and none of them worked. By trying the latest version I get the following errors:

Unable to start OpenMRS. Error thrown was: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/D:/tomcat9/temp/1464806415246.openmrs-lib-cache/owa/owa.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
org.openmrs.module.ModuleException: Unable to start OpenMRS. Error thrown was: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/D:/tomcat9/temp/1464806415246.openmrs-lib-cache/owa/owa.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
	at org.openmrs.web.WebDaemon.startOpenmrs(WebDaemon.java:65)
	at org.openmrs.web.Listener.contextInitialized(Listener.java:188)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4732)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5194)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
	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.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/D:/tomcat9/temp/1464806415246.openmrs-lib-cache/owa/owa.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
	at org.openmrs.web.Listener.startOpenmrs(Listener.java:268)
	at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/D:/tomcat9/temp/1464806415246.openmrs-lib-cache/owa/owa.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
	at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:842)
	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)
	... 1 more
Caused by: java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:571)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:490)
	at org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.determineUrlsForHandlerMethods(DefaultAnnotationHandlerMapping.java:178)
	at org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.determineUrlsForHandler(DefaultAnnotationHandlerMapping.java:153)
	at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:79)
	at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58)
	at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:120)
	at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:76)
	at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:74)
	at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:119)
	at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:94)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1558)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
	... 14 more
Caused by: java.lang.ClassNotFoundException: org.openmrs.ConceptAttributeType
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1299)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1133)
	at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:563)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 31 more

Any ideas how I can fix this? Any tip would be greatly appreciated! Thanks!

Can you try version 0.2 of the legacyui module?

Hi @dkayiwa

legacyui release 0.2 depends on <openMRSVersion>2.0.0-alpha1</openMRSVersion> which does not exist.

see

I personally tried 0.2 and couldnt deploy it to 2.0.0-alpha because of this. There is also another thread on talk but I couldnt find it.

Thank you for your quick reply, @dkayiwa! I have tried to install the suggested version but when running the localhost nothing changed (I don’t get any errors and I get the message that OpenMRS Platform 2.0.0-beta.e93da8 Running!) I thought I was doing something wrong but then i checked my log and it says that:

 Error while trying to start module: legacyui
org.openmrs.module.ModuleException: Module requires version matching 2.0.0-alpha1.  Current code version is 2.0.0
        at org.openmrs.module.ModuleUtil.checkRequiredVersion(ModuleUtil.java:355)
        at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:642)
        at org.openmrs.api.context.Daemon$1.run(Daemon.java:74)

@teleivo i have just uploaded version 0.2.1 to the module repository. Try it out and see if it works.

@dianad which version of the legacyui module are you using?

I have tried with 0.3 from https://modules.openmrs.org/#/show/231/legacy-ui-module and with 0.2.1 from the github repository

I get the same errors with the 0.2.1 version:

org.openmrs.module.ModuleException: Unable to start OpenMRS. Error thrown was: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/D:/tomcat9/temp/1464866287932.openmrs-lib-cache/fhir/fhir.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
	at org.openmrs.web.WebDaemon.startOpenmrs(WebDaemon.java:65)
	at org.openmrs.web.Listener.contextInitialized(Listener.java:188)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4732)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5194)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
	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.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in URL [jar:file:/D:/tomcat9/temp/1464866287932.openmrs-lib-cache/fhir/fhir.jar!/webModuleApplicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/openmrs/ConceptAttributeType
	at org.openmrs.web.Listener.startOpenmrs(Listener.java:268)
	at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)

@dianad i suspect that your platform is not using the correct module version. How are you installing the updated module?

git cloned it from https://github.com/openmrs/openmrs-module-legacyui.git build it with

cd openmrs-module-legacyui
mvn clean install

copied the omod file legacyui-1.0-SNAPSHOT to my C:\Users\Diana\AppData\Roaming\OpenMRS\modules

and restarted the service

I can deploy legacyui 0.2.1 into platform 2.0.0-alpha. But to me it seems you didnt change the openmrs version in the pom https://github.com/openmrs/openmrs-module-legacyui/blob/0.2.1/pom.xml#L37

shouldnt this be

<openMRSVersion>2.0.0-alpha</openMRSVersion>

instead of

<openMRSVersion>2.0.0-alpha1</openMRSVersion>

2.0.0-alpha1 does not exist, see https://github.com/openmrs/openmrs-core/releases

@dianad can you paste your tomcat log at pastebin.com?

@teleivo it should even have been 2.0.0-beta but i noticed that would not work for you. So i just changed this: https://github.com/openmrs/openmrs-module-legacyui/blob/0.2.1/omod/src/main/resources/config.xml#L15

thanks @dkayiwa I will try!

Thank you for the reply! Here’s the link to pastebin: OpenMRS Log

@dianad this does not seem to have all that i need. Can you paste the entire contents?

I didn’t delete anything, these were all the contents from the openmrs log.

I deleted and installed the same omod file again. This is my new log.

@dianad what is the name of the log file from which you are copying this?

It’s the openmrs.log from Users\AppData

That does not have everything. Check the actual tomcat logs.

dear @dkayiwa is it possible for you to post on a wiki how to currently deploy the legacyui and also which of the released versions works with which of the current openmrs 2.0.x releases (alpha, beta, …). I would really like to switch the radiology module to use 2.0.x + legacyui but I just cant seem to find a combination that works (0.2.1, 0.3, 1.0-SNAPSHOT) with (2.0.0-alpha, 2.0.0-beta, 2.0.0-SNAPSHOT). thanks a lot!