I successfully installed standalone v2.6.0. I added reference application: referenceapplication-addons-2.13.0 and when I restarted the tomcat server and tried to open the login page the error avove came up instead. Here is an exerpt: Unable to start OpenMRS. Error thrown was: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘conversionService’: Unsatisfied dependency expressed through field ‘springManagedConverters’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘stringToAppDescriptorConverter’: Unsatisfied dependency expressed through field ‘appFrameworkService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘org.openmrs.module.appframework.service.AppFrameworkService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘appFrameworkService’ defined in URL [jar:file:/C:/Users/Administrator/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/appframework.jar!/moduleApplicationContext.xml]: Cannot create inner bean ‘org.openmrs.module.appframework.service.AppFrameworkServiceImpl#45bdc32f’ 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#45bdc32f’ defined in URL [jar:file:/C:/Users/Administrator/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/appframework.jar!/moduleApplicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openmrs.module.appframework.service.AppFrameworkServiceImpl]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: jdk/nashorn/api/scripting/NashornScriptEngineFactory Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘appFrameworkService’ defined in URL [jar:file:/C:/Users/Administrator/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/appframework.jar!/moduleApplicationContext.xml]: Cannot create inner bean ‘org.openmrs.module.appframework.service.AppFrameworkServiceImpl#45bdc32f’ 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#45bdc32f’ defined in URL [jar:file:/C:/Users/Administrator/Application%20Data/OpenMRS/.openmrs-lib-cache/appframework/appframework.jar!/moduleApplicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openmrs.module.appframework.service.AppFrameworkServiceImpl]:
Oh sorry! Based on the error logs above, it seems that the application is trying to create a bean named stringToAppDescriptorConverter
. However, this bean has a field called appFrameworkService
, which requires a bean of type org.openmrs.module.appframework.service.AppFrameworkService
to be available in the application context. However, Spring cannot find any bean that matches this type.
To resolve this issue, you need to ensure that a bean of type AppFrameworkService
is defined and available in your application context. This can be done by either creating a bean definition for AppFrameworkService
or ensuring that the appropriate module or component providing this service is correctly configured and initialised in the application. Though am not certain if the this will work since Standalone server
has not been released for a while.
Thanks so much for the help. I figured I was using an unsupported java version. I downgraded to java 7 and everything worked. Thanks again.
Which Java version are you running?
We could also reference this Error when installing the standalone application - #18 by jwnasambu
It looks like a ton of things are going wrong with the reference application modules and Java 11. I experience it myself when I am building any module.
@dkayiwa we might need to pay attention to reference app modules building on java 11.
Oh sorry! when it comes to java version we are still using 8.
@slubwama We support running on Java 11, but not building (outside of core). Supporting building on Java 11 means dropping support for any version of core prior to 2.4.0 in the module. This is because it’s only in version 2.4.0 that we have versions of Spring and Hibernate that can support Java 11:
The specific error in this thread, however, is related to using a version of Java newer than 15, since Nashhorn (Java’s JavaScript runtime) was removed from the JDK in that version. We do not currently support Java newer than 15, mostly for this reason (the entire RefApp 2.x heavily depends on Nashhorn). (Patches to fix this are very welcome!)
@ibacher I do understand that and know that it’s difficult to choose between moving forward and backward compatibility. At some point, we may have to ensure that we can support that and also move forward to use other latest versions of Java.
The Nashhorn is a known one given that in Java 11 the warning messages are there to indicate that they will be dropping Nashhorn from mainstream libraries of Java and introduce it as a separate module of Java given the modularity Java comes with. I have read in a number of places that recommend including the Nashhorn beyond Java 11 as seen below
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<version>15.0</version>
</dependency>
I also noticed that there are few modules in openmrs if not just one where this can be declared so as to offer Java 15 support.
I believe that we can move forward if we plan it so well.
@dkayiwa I am facing issues with lots of failing tests due to the app framework. I need your help looking into this so that we can move toward the release of 4.0.0 of UgandaEMR Here is a pastebin collection to the errors currently being faced Possible Spam Detected - Pastebin.com
@slubwama which GitHub repository is this?
@dkayiwa GitHub - METS-Programme/openmrs-module-ugandaemr: This is UgandaEMR Core. The foundation of UgandaEMR an electronic medical records system.
@slubwama i have just cloned that project and successfully run mvn clean install
@dkayiwa the master branch that you running is based on 2.3.1 openmrs core and works fine however the branch 3.x branch that is based on core 2.5.8 is not okay. I also have a PR where I am merging back 3.x into the master
@slubwama i do not seem to understand your response.
@dkayiwa made some edits to the last response hope its clear
@slubwama i have just pulled in the latest changes and compiled them successfully with mvn clean install