Problem starting Platform on Ubuntu 16.04 LTS

I am unsuccessful at starting Platform 1.9.x on my laptop with new Ubuntu 16.04. I will try with Platform 1.10.x as maybe the problem is corrected.

Anyone running Platform on Ubuntu 16.04?

Ubuntu 16.04 replaced these 2 packages, but I restored to the previous versions:

  • MySQL 5.7 installs by default. Reinstalled MySQL 5.6.
  • Java 1.7 Oracle installs by default. Reinstalled java-7-openjdk, but it doesn’t correct this error which appears in the logfile (and homepage after a liquibase update):

ERROR - ContextLoader.initWebApplicationContext(225) |2016-05-06 08:38:40,328| Context initialization failed
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368)
at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367)
at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:195)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:144)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:404)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.openmrs.web.Listener.contextInitialized(Listener.java:143)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
ERROR - Listener.contextInitialized(150) |2016-05-06 08:38:40,332| Got exception while starting up: 
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368)
at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367)
at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:195)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:144)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:404)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.openmrs.web.Listener.contextInitialized(Listener.java:143)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Could it be a problem with PHP7 that is also bundled with it?

I was able to reproduce this on a Vagrant box (ubuntu/xenial64). The issue I believe lies in the specific versions of Tomcat and Java that you are trying to use. Specifically, I reproduced this by using the openjdk-7-jdk and tomcat7-user packages:

sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-7-jdk sudo apt-get install tomcat7-user

This thread ended up giving what I think is the right answer (thanks @mogoodrich for the suggestion): https://bz.apache.org/bugzilla/show_bug.cgi?id=55554

If I install the tomcat7-user package on Ubuntu 14.04, the contents of META-INF/MANIFEST.MF in catalina.jar (found in /usr/share/tomcat7/lib/) are:

Manifest-Version: 1.0 Ant-Version: Apache Ant 1.9.3 Created-By: 1.7.0_79-b14 (Oracle Corporation) Specification-Title: Apache Tomcat Specification-Version: 7.0 Specification-Vendor: Apache Software Foundation Implementation-Title: Apache Tomcat Implementation-Version: 7.0.52 Implementation-Vendor: Apache Software Foundation X-Compile-Source-JDK: 1.6 X-Compile-Target-JDK: 1.6

By contrast, installing the same package on Ubuntu 16.04 shows these contents in the same file:

Manifest-Version: 1.0 Ant-Version: Apache Ant 1.9.6 Created-By: 1.8.0_01-internal-b15 (Oracle Corporation) Specification-Title: Apache Tomcat Specification-Version: 7.0 Specification-Vendor: Apache Software Foundation Implementation-Title: Apache Tomcat Implementation-Version: 7.0.68 Implementation-Vendor: Apache Software Foundation X-Compile-Source-JDK: 1.6 X-Compile-Target-JDK: 1.6

My read of this (and it could be wrong) is that the particular RPM build of Tomcat (as delivered by the tomcat7-user package) was created with Java 8 for Ubuntu 16.04 , whereas the same RPM package was built with Java 7 for Ubuntu 14.04. And despite the intended compatibility with Java 1.6+ (at least that’s what I interpret from the X-Compile-Source-JDK and X-Compile-Target-JDK attributes) this version of Tomcat actually is not compatible with Java 7.

I’d be interested in others thoughts on this who may know more about these underlying compatibilities. Is it possible that this is a bug in Tomcat’s Ubuntu 16.04 build?

Mike

I’m not on Ubuntu, but FWIW, I think that the latest OpenMRS releases run on Java 8, so maybe you can try that, instead of Java 7…

Do we know if anyone is using Tomcat 8 w/ OpenMRS?

OpenMRS works on Ubuntu 16.04 LTS with jetty but not tomcat7 when I use the same java (java-7-oracle) and mysql (5.6).

I believe this shows that @mseaton 's assumption is correct – The RPM tomcat build was created with Java 8 for Ubuntu 16.04 and not compatible with Java 7.

We haven’t tried Tomcat 8 or Java 8.

Ellen

Has anyone successfully installed OpenMRS on Ubuntu 16.04 with tomcat? I have not tried with Java 8 or Tomcat 8.

Anyone?

Hi,

Yes, Instead of the tomcat version from the Ubuntu 16,04 Package system, we used the same version apache-tomcat-7.0.68, but from the site http://archive.apache.org/dist/tomcat/tomcat-7/. As per the META-INF/MANIFEST.MF it was created by Java 1.6.0_45. So it seems that indeed it is a particular issue of the Ubuntu tomcat package.

If on need of instructions for the manual installations check here http://tecadmin.net/install-tomcat-7-on-ubuntu/

Euclides

1 Like

I did but, it was on centos. I used tomcat8 and java8. It installed fine with no issues.

When I reverted back to mysql 5.6 and tomcat7 OpenMRS worked fine

I switched to using the OpenMRS SDK on Ubuntu 16.04. It works fine.

https://wiki.openmrs.org/display/docs/OpenMRS+SDK

Ellen