gpt4 book ai didi

tomcat7 - 在 Tomcat7 服务器上运行 Web 服务时出现错误 - Ubuntu 16.04 LTS

转载 作者:行者123 更新时间:2023-12-02 21:14:49 26 4
gpt4 key购买 nike

Technical Environment:-

  • Ubuntu 16.04 LTS
  • Tomcat 7
  • Java 7
  • Eclipse Luna

我已将一个 Web 服务导入到我的 eclipse luna 工作区中,并尝试在 tomcat7 服务器上运行该服务。但我收到以下错误。

Jul 24, 2016 5:39:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:service' did not find a matching property.

Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.68 (Ubuntu)
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 27 2016 18:13:17 UTC
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log

INFO: Server number: 7.0.68.0
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 4.4.0-28-generic
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/lib/jvm/java-7-oracle/jre
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_80-b15
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /home/shravan/Projects/Webservices/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /usr/share/tomcat7
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/home/shravan/Projects/Webservices/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/usr/share/tomcat7
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/home/shravan/Projects/Webservices/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Jul 24, 2016 5:39:31 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 24, 2016 5:39:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 781 ms
Jul 24, 2016 5:39:31 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 24, 2016 5:39:31 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68 (Ubuntu)
Jul 24, 2016 5:39:31 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jul 24, 2016 5:39:33 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jul 24, 2016 5:39:33 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 24, 2016 5:39:33 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jul 24, 2016 5:39:33 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Jul 24, 2016 5:39:33 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
Jul 24, 2016 5:39:34 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Jul 24, 2016 5:39:34 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dataSource.xml]
Jul 24, 2016 5:39:34 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: 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:200)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:165)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
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$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
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)
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
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:200)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:165)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
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$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
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)
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/service] startup failed due to previous errors
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Jul 24, 2016 5:39:34 PM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
Jul 24, 2016 5:39:34 PM org.springframework.context.support.AbstractApplicationContext doClose
WARNING: Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:346)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:880)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
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)
Jul 24, 2016 5:39:34 PM org.springframework.context.support.AbstractApplicationContext doClose
WARNING: Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:359)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:888)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
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)
Jul 24, 2016 5:39:34 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 24, 2016 5:39:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3547 ms

请指出可能的解决方案。非常感谢。

最佳答案

我最近也遇到了同样的问题。

Tomcat 7 类似乎是在 Ubuntu 16.04 中使用 Java 8 库编译的,因此无法使用 Java 7 运行它。

这是来自存储库的 catalina.jar (7.0.68):

# javap -verbose org/apache/catalina/core/ApplicationContext.class
Classfile /usr/share/tomcat7/lib/org/apache/catalina/core/ApplicationContext.class
Last modified 27/06/2016; size 33798 bytes
MD5 checksum b176f6c6f5854428fbfa67b298ed308a
Compiled from "ApplicationContext.java"
public class org.apache.catalina.core.ApplicationContext implements javax.servlet.ServletContext
SourceFile: "ApplicationContext.java"
InnerClasses:
public static #479= #478 of #943; //Dynamic=class javax/servlet/FilterRegistration$Dynamic of class javax/servlet/FilterRegistration
public static #479= #511 of #945; //Dynamic=class javax/servlet/ServletRegistration$Dynamic of class javax/servlet/ServletRegistration
public static #1005= #1004 of #2; //KeySetView=class java/util/concurrent/ConcurrentHashMap$KeySetView of class java/util/concurrent/ConcurrentHashMap
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_SUPER

这是从 Apache 下载的 catalina.jar (7.0.68):

# javap -verbose org/apache/catalina/core/ApplicationContext.class
Classfile /root/apache-tomcat-7.0.68/lib/org/apache/catalina/core/ApplicationContext.class
Last modified 08/02/2016; size 33585 bytes
MD5 checksum eda7f125c1ef506be98d360f6611a717
Compiled from "ApplicationContext.java"
public class org.apache.catalina.core.ApplicationContext implements javax.servlet.ServletContext
SourceFile: "ApplicationContext.java"
InnerClasses:
public static #481= #480 of #946; //Dynamic=class javax/servlet/FilterRegistration$Dynamic of class javax/servlet/FilterRegistration
public static #481= #513 of #948; //Dynamic=class javax/servlet/ServletRegistration$Dynamic of class javax/servlet/ServletRegistration
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_SUPER

两者都编译为类格式 50 (Java 6),但存储库类具有指向 Java 8 独占方法的链接:

public static #1005= #1004 of #2; //KeySetView=class java/util/concurrent/ConcurrentHashMap$KeySetView of class java/util/concurrent/ConcurrentHashMap

因此,如果您想在 Ubuntu 16.04 中运行带有 Java 7 的 Tomcat 7,您必须直接从 Apache 下载并手动安装。

关于tomcat7 - 在 Tomcat7 服务器上运行 Web 服务时出现错误 - Ubuntu 16.04 LTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38583495/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com