Failed to install OpenMRS - java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException


(Mohammad Zafar Shafaq) #1

Here is my environment:

  • Tomcat v9.0
  • Java v1.8.0_191
  • OpenMRS core v2.1.4
  • ReferenceApplication v2.8.0

Here is my error message: Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘appFrameworkService’ defined in URL [jar:file:/C:/Windows/System32/config/systemprofile/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/lib/appframework-api-2.11.0.jar!/moduleApplicationContext.xml]: Cannot create inner bean ‘org.openmrs.module.appframework.service.AppFrameworkServiceImpl#ac6c0f1’ of type [org.openmrs.module.appframework.service.AppFrameworkServiceImpl] while setting bean property ‘target’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.openmrs.module.appframework.service.AppFrameworkServiceImpl#ac6c0f1’ defined in URL [jar:file:/C:/Windows/System32/config/systemprofile/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/lib/appframework-api-2.11.0.jar!/moduleApplicationContext.xml]: Cannot resolve reference to bean ‘allAppTemplates’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘allAppTemplates’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.validation.Validator org.openmrs.module.appframework.repository.AllAppTemplates.validator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘validatorFactory’ defined in URL [jar:file:/C:/Windows/System32/config/systemprofile/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/lib/appframework-api-2.11.0.jar!/moduleApplicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
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:199)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:741)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:894)
at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:866)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:656)
at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:635)
at org.openmrs.web.Listener.startOpenmrs(Listener.java:266)
... 1 more

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: java.util.Set org.openmrs.module.uiframework.UiFrameworkConversionServiceFactoryBean.springManagedConverters; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘stringToAppDescriptorConverter’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.openmrs.module.appframework.service.AppFrameworkService org.openmrs.module.appui.converter.StringToAppDescriptorConverter.appFrameworkService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.openmrs.module.appframework.service.AppFrameworkService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) … 15 more

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘stringToAppDescriptorConverter’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.openmrs.module.appframework.service.AppFrameworkService org.openmrs.module.appui.converter.StringToAppDescriptorConverter.appFrameworkService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.openmrs.module.appframework.service.AppFrameworkService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) 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.findAutowireCandidates(DefaultListableBeanFactory.java:1127) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1003) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) … 17 more

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.openmrs.module.appframework.service.AppFrameworkService org.openmrs.module.appui.converter.StringToAppDescriptorConverter.appFrameworkService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.openmrs.module.appframework.service.AppFrameworkService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) … 28 more

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.openmrs.module.appframework.service.AppFrameworkService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1308) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1054) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) … 30 more


(Nathan Ruhanga) #2

@zafar1234 , could this be happening with a fresh instance of the reference application, or are there changes that you may have made related to the upgrading of modules or even openmrs-core? You may need to clearly describe the steps to reproduce this and also paste the error log at pastebin.com then drop the link here for legibility.


(Moses Mutesasira) #3
  • @zafar1234, as @ruhanga advised …used pastebin to paste the error logs .

  • Now regarding the error , Dii you just download a whole set of reference app modules and try to install them or did u manually compile some modules your self …probably its because of your local changes. ??


(Kaweesi Joseph) #4

does this happen with a lower tomcat version? am not sure i have tested with tomcat 9


(Mohammad Zafar Shafaq) #5

Dear Colleagues, Thank you for your reply!

I have download the OpenMRS from this official link (https://openmrs.org/download/). I didn’t made any manual changes to them.

Just I copied the reference application files to my module folder.

It use tomcat version 9

Thank you