简体   繁体   English

Tomcat 7 NoSuchMethodError:java.util.concurrent.ConcurrentHashMap.keySet()

[英]Tomcat 7 NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()

I am having trouble deploying a web application on tomcat 7. The application is compiled using JDK 7 so I configured tomcat to use JDK 7 by setting JAVA_HOME=/usr/lib/jvm/jdk1.7.0_80/ in /etc/default/tomcat7 . 我无法在tomcat 7上部署Web应用程序。该应用程序是使用JDK 7编译的,因此我通过在/etc/default/tomcat7设置JAVA_HOME=/usr/lib/jvm/jdk1.7.0_80/来配置tomcat使用JDK 7。 。 When I run top I can confirm that tomcat is using java 7. However when I try to browse the application I get the following exception 当我运行top我可以确认tomcat使用的是Java7。但是,当我尝试浏览该应用程序时,出现以下异常

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 com.intel.mtwilson.jpa.PersistenceManager.contextInitialized(PersistenceManager.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)

As far as I understand this method has different return types in JDK 7 and JDK 8 and tomcat is for some reason looking for the JDK 8 version even through it is configured to run in JDK 7. What is the reason for this? 据我了解,此方法在JDK 7JDK 8中具有不同的返回类型,并且tomcat出于某种原因正在寻找JDK 8版本,即使已将其配置为在JDK 7中运行。这是什么原因呢? Do I have to configure anything else to make tomcat use JDK 7? 我是否需要配置其他任何东西才能使tomcat使用JDK 7?

I think the issue is the the Tomcat you are using wasn't actually compiled with Java 7. It looks like there are some Tomcat 7 builds floating around that were compiled with Java 8 . 我认为问题是您所使用的Tomcat并非实际上是使用Java 7编译的。 看起来好像有一些Tomcat 7构建在Java 8之上

You should use Java 8. Even if Tomcat was compiled with Java 7, it should run on Java 8. 您应该使用Java8。即使Tomcat是使用Java 7编译的,它也应在Java 8上运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java错误java.util.concurrent.ConcurrentHashMap.keySet - Java error java.util.concurrent.ConcurrentHashMap.keySet Java ConcurrentHashMap.keySet()挂起 - Java ConcurrentHashMap.keySet() hangs Findbugs-调用java.util.concurrent.ConcurrentHashMap的顺序可能不是原子的 - Findbugs - Sequence of calls to java.util.concurrent.ConcurrentHashMap may not be atomic java.util.concurrent.ConcurrentHashMap.putIfAbsent是否需要在同步块中? - Does java.util.concurrent.ConcurrentHashMap.putIfAbsent need to be in a syncronized block? ProcessSimulator.killAllProcesses(line:78)NoSuchMethodError ConcurrentHashMap.keySet() - ProcessSimulator.killAllProcesses(line:78) NoSuchMethodError ConcurrentHashMap.keySet() java.lang.NoSuchMethodError:com.google.common.util.concurrent.MoreExecutors.platformThreadFactory()Ljava / util / concurrent / ThreadFactory; - java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.platformThreadFactory()Ljava/util/concurrent/ThreadFactory; 引起:java.lang.IllegalStateException:递归更新在 java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1760) - Caused by: java.lang.IllegalStateException: Recursive update at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1760) 如何解决findbug调用java.util.concurrent.ConcurrentHashMap的顺序可能不是原子的 - How to resolve the findbug Sequence of calls to java.util.concurrent.ConcurrentHashMap may not be atomic 使用java.util.concurrent.Executor会阻止tomcat停止 - Use of java.util.concurrent.Executor stops tomcat from stopping 启动tomcat 7时java.util.concurrent.ExecutionException - java.util.concurrent.ExecutionException when starting tomcat 7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM