Tomcat 8抛出错误:'启动时子容器失败' [英] Tomcat 8 throws error : 'A child container failed during start'

查看:375
本文介绍了Tomcat 8抛出错误:'启动时子容器失败'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在处理计算机上的代码并将该代码导入到其他计算机上。但是当我部署代码并在另一台机器上运行时,tomcat无法正常启动并抛出错误。

I have been working on a code on my computer and imported that code on other machine. But when I deploy code and run it on the other machine, tomcat doesn't start properly and throws error.

web.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>Try</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description>Apache CXF Endpoint</description>
    <display-name>cxf</display-name>
    <servlet-name>cxf</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>cxf</servlet-name>
    <url-pattern>/services/ *</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>60</session-timeout>
  </session-config>
  <servlet>
    <description>JAX-RS Tools Generated - Do not modify</description>
    <servlet-name>JAX-RS Servlet</servlet-name>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>JAX-RS Servlet</servlet-name>
    <url-pattern>/jaxrs/*</url-pattern>
  </servlet-mapping>
</web-app>

控制台日志:


2017年1月11日上午1:33:12
org.apache.tomcat.util.digester.SetPropertiesRule开始警告:
[SetPropertiesRule] {服务器/服务/ Engine / Host / Context}将
属性'source'设置为'org.eclipse.jst.jee.server:尝试'找不到
匹配属性。 2017年1月11日上午1:33:12
org.apache.catalina.startup.VersionLoggerListener日志信息:服务器
版本:Apache Tomcat / 8.0.39

Jan 11, 2017 1:33:12 AM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Try' did not find a matching property. Jan 11, 2017 1:33:12 AM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version: Apache Tomcat/8.0.39

SEVERE:启动时子容器失败
java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:启动组件失败[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/尝试]]
在java.util.concurrent.FutureTask.report(FutureTask.java:122)Blockquote

SEVERE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Try]] at java.util.concurrent.FutureTask.report(FutureTask.java:122)Blockquote

引起:org.apache.catalina.LifecycleException :无法启动
组件
[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ Try]]
at
org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:162)
... 6更多引起:java.lang.IllegalArgumentException:无法
创建[com.sun.faces.config.ConfigureListener]类型的实例
atg.apache.catalina.core.ApplicationContext.addListener

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Try]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) ... 6 more Caused by: java.lang.IllegalArgumentException: Unable to create an instance of type [com.sun.faces.config.ConfigureListener] at org.apache.catalina.core.ApplicationContext.addListener

Cau sed by:java.lang.ClassNotFoundException:
com.sun.faces.config.ConfigureListener at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)

Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)

我试过其他解决方案对于Stack Exchange上的同样问题。但没有什么对我有用。

I have tried other solutions for the same problem on Stack Exchange. But nothing works for me.

推荐答案

似乎导致类 com.sun.faces.config .ConfigureListener 存在于您的计算机中但不存在于目标计算机中。此类通常属于 jsf-impl.jar jsf-ri.jar 库。

It seems that the causing class com.sun.faces.config.ConfigureListener is present in your computer but not in the target machine. This class usually belongs to jsf-impl.jar or jsf-ri.jar libraries.

由于你在两台机器上部署相同的战争(我假设),这些库显然没有进入战争,因此它们可能会进入你的计算机的Tomcat运行时:在目录中查找它< tomcat> / lib 并将其复制到目标机器的Tomcat lib目录中。

Since you are deploying the same war (I assume) on both machines, that libraries are obivously not into the war, so they are likely to be into your computer's Tomcat runtime: Look for it in directory <tomcat>/lib and copy it into the target machine's Tomcat lib directory.

这篇关于Tomcat 8抛出错误:'启动时子容器失败'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆