REST Module Install Error

I successfully built the module and openmrs-contrib-docs as given in the instructions. Then I tried installing the openMRS as given in https://wiki.openmrs.org/display/docs/Installing+OpenMRS . I was able to successfully run the OpenMRS platform. Then I tried installing the Legacy UI module as given in https://wiki.openmrs.org/display/docs/User+Interface+Modules. After copying the .omod file to ${HOME}./OpenMRS/modules and restarting tomcat server there comes an exception as given below [1] and I get the same page in the tomcat server saying “no user interface module is installed”. Any help is appreciated.

[1]

Exception in thread "Thread-9" java.lang.NoClassDefFoundError: javax/servlet/ServletRegistration
    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.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:474)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1057)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1030)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    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:658)
    at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:637)
    at org.openmrs.web.Listener.startOpenmrs(Listener.java:268)
    at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRegistration
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
    at org.openmrs.module.ModuleClassLoader.loadClass(ModuleClassLoader.java:563)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 24 more

If anyone has an idea please help me with this problem.

Hi @bhashinee ,Welcome to OpenMRS! Please note that this thread is meant for the sole purpose of discussing your ideas related to the project. For any other issues that you might be facing like the one above, you may create a new post on talk. As far as your current problem is concerned, in Ubuntu, if you have gone to the hidden folder(. OpenMRS) in your home directory and have placed the legacy UI omod inside the modules folder there and restarted Tomcat ,it should start running. If not then you may start a new post on talk. Another friendly suggestion would be to use sites like http://pastebin.com for posting larger pieces of code :slight_smile: .

1 Like

I moved this out of the GSOC thread.

What version of OpenMRS do you have installed? Are you able to access the system information page (of your local instance)? If so, what is the value of Local repository in the Module Information section?