2016-03-04 63 views
0

我的tomcat應用在openSUSE 13.2上的tomcat 7.0.55上運行良好。在tomcat 7.0和tomcat 8.0之間改變什麼

我需要使該應用程序在openSUSE 13.2上的tomcat 8.0.32上工作。我可以成功安裝tomcat 8.0.32。

[email protected]:~> java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo 
Server version: Apache Tomcat/8.0.32 
Server built: Feb 22 2016 11:10:58 UTC 
Server number: 8.0.32.0 
OS Name:  Linux 
OS Version:  3.10.0-123.el7.x86_64 
Architecture: amd64 
JVM Version: 1.7.0_95-b00 
JVM Vendor:  Oracle Corporation 

我沒有對文件夾結構或目錄或應用程序做任何更改。現在,當我運行它時,它會拋出許多錯誤,我無法弄清楚如何解決。我們需要在這兩個版本之間進行更改?

04-Mar-2016 08:48:02.971 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:  Apache Tomcat/8.0.32 
04-Mar-2016 08:48:02.975 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:   Feb 22 2016 11:10:58 UTC 
04-Mar-2016 08:48:02.975 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:   8.0.32.0 
04-Mar-2016 08:48:02.976 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:    Linux 
04-Mar-2016 08:48:02.976 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:   3.10.0-123.el7.x86_64 
04-Mar-2016 08:48:02.976 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:   amd64 
04-Mar-2016 08:48:02.977 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:    /usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre 
04-Mar-2016 08:48:02.977 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:   1.7.0_95-b00 
04-Mar-2016 08:48:02.977 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:   Oracle Corporation 
04-Mar-2016 08:48:02.978 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:   /usr/share/tomcat 
04-Mar-2016 08:48:02.978 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:   /usr/share/tomcat 
04-Mar-2016 08:48:02.979 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/tomcat/ 
04-Mar-2016 08:48:02.979 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat/ 
04-Mar-2016 08:48:02.980 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs= 
04-Mar-2016 08:48:02.980 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/var/cache/tomcat/temp 
04-Mar-2016 08:48:02.980 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat//conf/logging.properties 
04-Mar-2016 08:48:02.981 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
04-Mar-2016 08:48:02.981 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 
04-Mar-2016 08:48:03.688 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"] 
04-Mar-2016 08:48:03.750 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 
04-Mar-2016 08:48:03.757 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"] 
04-Mar-2016 08:48:03.764 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 
04-Mar-2016 08:48:03.765 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8443"] 
04-Mar-2016 08:48:04.402 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 
04-Mar-2016 08:48:04.403 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 3307 ms 
04-Mar-2016 08:48:04.452 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 
04-Mar-2016 08:48:04.452 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32 
04-Mar-2016 08:48:04.531 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /srv/tomcat/webapps/stig.war 
04-Mar-2016 08:48:06.950 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/stig]] 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) 
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) 
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 
     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) 
     at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812) 
     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; 
     at org.apache.catalina.core.StandardContext.findParameters(StandardContext.java:3585) 
     at org.apache.catalina.core.StandardContext.mergeParameters(StandardContext.java:5409) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5238) 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) 
     ... 10 more 

04-Mar-2016 08:48:06.955 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /srv/tomcat/webapps/stig.war 
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/stig]] 
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729) 
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 
     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) 
     at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812) 
     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) 

04-Mar-2016 08:48:06.961 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /srv/tomcat/webapps/stig.war has finished in 2,428 ms 
04-Mar-2016 08:48:06.963 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /srv/tomcat/webapps/ROOT 
04-Mar-2016 08:48:08.233 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) 
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) 
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 
     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1091) 
     at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1830) 
     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; 
     at org.apache.catalina.core.StandardContext.findParameters(StandardContext.java:3585) 
     at org.apache.catalina.core.StandardContext.mergeParameters(StandardContext.java:5409) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5238) 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) 
     ... 10 more 

04-Mar-2016 08:48:08.234 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory /srv/tomcat/webapps/ROOT 
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] 
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729) 
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 
     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1091) 
     at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1830) 
     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) 

04-Mar-2016 08:48:08.236 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /srv/tomcat/webapps/ROOT has finished in 1,272 ms 
04-Mar-2016 08:48:08.251 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 
04-Mar-2016 08:48:08.270 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 
04-Mar-2016 08:48:08.273 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8443"] 
04-Mar-2016 08:48:08.276 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 3872 ms 
+0

沒什麼不尋常的。基本的java罐子。 – praving5

回答

1

它是由這個例外

Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView; 

你應該嘗試使用的Java 1.8,而不是1.7造成的。 ConcurrentHashMap的1.8版本的keyset()方法改變了返回類型http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html#keySet--

與1.7版本比較:http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html#keySet--)./ConcurrentHashMap.html#keySet%28%29

+0

好的,安裝jdk 1.8。我認爲tomcat 8.0會自動安裝它可以使用的jvm。將在幾分鐘後發佈結果。謝謝。 – praving5

+0

太棒了!這就像一個魅力。謝謝是不夠的。自從早上起我就一直在努力。你搖滾! – praving5

+0

歡迎您:) –

1

您的機器上是否安裝了java 8? 看來tomcat 8正在尋找自java 1.8以來增加的ConcurrentHashMap的一種方法

編輯:我剛纔看到現在你正在運行jvm 7.0,試用8.0,它應該運行良好。

+0

太棒了!這就像一個魅力。謝謝是不夠的。自從早上起我就一直在努力。你搖滾! – praving5

0

對我來說,「tomcat 8.0.23」在JDK 1.8和1.7下運行良好。 似乎這個問題在他們的最新版本「tomcat 8.0.32」中被裁剪。 正如建議嘗試使用JDK 8.這應該有助於解決。

這可能是Tomcat最新版本的一個文檔錯誤;作爲他們的在線setup page以及RUNNING.txt(隨附可安裝),提及它將與「1.7或以上」一起使用。測試成功後,您可能想指出它們。