tomcat7 package compiled with java 1.8

Bug #1669093 reported by Marcos Jr
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat7 (Ubuntu)
Triaged
Undecided
Nish Aravamudan

Bug Description

Tomcat 7 package for Ubuntu 16.04.2 LTS (xenial) was compiled with java 1.8.

Must be compiled with java 1.7 due to compilation issues that leads to exceptions like this:

```
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)

```

It is detailed by Mike Seaton at this post:

https://talk.openmrs.org/t/problem-starting-platform-on-ubuntu-16-04-lts/6190/3

> 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 current workaround is to replace /usr/share/tomcat7 with official apache tomcat7 binary tar.gz .

Revision history for this message
Nish Aravamudan (nacc) wrote :

Hello and thank you for filing this bug report!

I am reviewing the related bug reports and will provide an update later today.

Is there a simple testcase for reproducing this issue?

Changed in tomcat7 (Ubuntu):
status: New → Triaged
assignee: nobody → Nish Aravamudan (nacc)
Revision history for this message
Marcos Jr (junalmeida) wrote :

Sorry but I don't have a test case since I'm not a java dev. I guess that a simple java webapp using that class compiled with jdk 1.8 may trigger the exception.

I just have a compiled java app from 3rd party to run at my server and I'm upgrading it (the OS).
I'm not sure that the exception comes from internals of tomcat or the app itself, the fact is that the tomcat 7 package behaves different from tomcat7 downloaded from apache.org with the same webapp. The same webapp works with tomcat7 package at a ubuntu trusty server.

It seems that a particular java class does not behave the same if compiled with java 8 even with compatibility with 1.6.

Revision history for this message
Joshua Powers (powersj) wrote :

I knew I had seen this report before, this looks like a dup of LP: #1625043

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.