Java version used to compile Tomcat7

Asked by El Achèche ANIS

I was trying to deploy a war that is working on Tomcat7 + Java 7 on Ubuntu 14.04 to a Tomcat7 on Ubuntu 16.04

The Webapp needs Java 7 to works, so I used a PPA to install it.

However I still get a compatibility errors that prevent the webapp from starting.

Below is the error:

==========================================
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:124)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
        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.deployDirectory(HostConfig.java:1259)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1998)
        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)
Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
        ... 5 more
==========================

Googling around, I find that the error is related to some Java version compatibility, and some folks mentioned that if Tomcat7 was compiled using Java8 that will cause that problem too even if the Java version used is Java7

How can I check if tomcat7 was compiled using Java8 or not?

Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu tomcat7 Edit question
Assignee:
No assignee Edit question
Solved by:
Joshua Powers
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Does the changelog detail it
https://launchpad.net/ubuntu/+source/tomcat7/+changelog

You could contact Josh Powers. His email address is quite prevalent in the chnagelog

Revision history for this message
Best Joshua Powers (powersj) said :
#2

Hi! Thanks for taking the time to reach out.

Your issue does, in fact, look like the following bug:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1625043

Revision history for this message
El Achèche ANIS (elacheche) said :
#3

Thanks Joshua Powers, that solved my question.

Revision history for this message
El Achèche ANIS (elacheche) said :
#4

Until the bug will be fixed, I'm using tomcat7 binary from the official Tomcat website.