OpenMRS won't start

Here is a portion of the error we are getting.

The following error occurred at startup: Unable to start OpenMRS. Error thrown was: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘messageSourceServiceTarget’ defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean ‘mutableResourceBundleMessageSource’ while setting bean property ‘activeMessageSource’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mutableResourceBundleMessageSource’ defined in class path resource [applicationContext-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0’ defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean ‘transactionInterceptor’ while setting bean property ‘transactionInterceptor’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionInterceptor’ defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean ‘transactionManager’ while setting bean property ‘transactionManager’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’ defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean ‘sessionFactory’ while setting bean property ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public java.util.Map org.openmrs.api.db.hibernate.HibernateSessionFactoryBean.interceptors; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.DataImportTool] for bean with name ‘dit’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/moduleApplicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/DataImportTool : Unsupported major.minor version 51.0 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.DataImportTool] for bean with name ‘dit’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/moduleApplicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/DataImportTool : Unsupported major.minor version 51.0 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.resources.DataImportToolValidator] for bean with name ‘dataImportToolValidator’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/webModuleApplicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/resources/DataImportToolValidator : Unsupported major.minor version 51.0 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.web.controller.DataImportToolStartMigrationController] for bean with name ‘dataImportToolStartMigrationController’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/webModuleApplicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/web/controller/DataImportToolStartMigrationController : Unsupported major.minor version 51.0 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.web.controller.ErrorController] for bean with name ‘errorController’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/org/openmrs/module/dataimporttool/web/controller/ErrorController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/web/controller/ErrorController : Unsupported major.minor version 51.0 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.web.controller.StatusController] for bean with name ‘statusController’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/org/openmrs/module/dataimporttool/web/controller/StatusController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/web/controller/StatusController : Unsupported major.minor version 51.0 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.openmrs.module.dataimporttool.web.controller.ContinueMigrationController] for bean with name ‘continueMigrationController’ defined in URL [jar:file:/tmp/tomcat6-tomcat6-tmp/1464938934191.openmrs-lib-cache/dataimporttool/dataimporttool.jar!/org/openmrs/module/dataimporttool/web/controller/ContinueMigrationController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: org/openmrs/module/dataimporttool/web/controller/ContinueMigrationController : Unsupported major.minor version 51.0 Related cause:

This is a Java version error. What version of Java are you running and what version of OpenMRS?

If running standalone – we do not support Java 8. – Use Java 7.

I ran this command from the Wiki.

sudo apt-get install openjdk-6-jdk

If I run java -version, I get 1.6.0_39

I ended up running “sudo apt-get install openjdk-7-jdk” and OpenMRS loads now. The username/password textboxes show up for a split second as the page loads, but it goes away when the page finishes loading. If you click login in the top right it’ll give me the following error.

HTTP Status 404 - /openmrs/null

type Status report

message /openmrs/null

description The requested resource is not available.

Apache Tomcat/6.0.39

Here’s my command output.

~$ java -version
java version “1.7.0_101”
OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

Running this version allows OpenMRS to open without the original errors, but now the main page loads, but only without the username and password login text boxes. If you click the login button on the top right-hand corner I get the following error.

HTTP Status 404 - /openmrs/null
type Status report
message /openmrs/null
description The requested resource is not available.
Apache Tomcat/6.0.39

Any help is greatly appreciated!! We really like this program and would like to use it explicitly, we are wanting to give a presentation on it this week for approval, but if we can’t get this resolved, it won’t look good. Please any quick help is appreciated.

@darkmatter5 are you still having problems?

@darkmatter5 I’ve been going through the error please what openmrs instance are you running and version, if running on a java servlet what version as well.

gg

Hello,

I have encountered almost a similar error as @darkmatter5 Link to my error: https://pastebin.com/zcEmQ4re I am using openmrs 2.1

Is Java8 still not supported?

My output for $java -version is: openjdk version “1.8.0_151” OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12) OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

I have done the complete installation and setup of openmrs with Java 8. So if I have to change my Java version, should I do the installation all over again? i.e., repeating Step 5 in https://wiki.openmrs.org/display/docs/Getting+Started+as+a+Developer

@kkavuri this happens when you are running the latest snapshot version of the platform. In that case, you would need to compile and use the latest snapshot version of the emrapi module https://github.com/openmrs/openmrs-module-emrapi

2 Likes