zoukankan      html  css  js  c++  java
  • Tomcat异常之——启动报错Failed to start component

    idea中运行tomcat时,遇到异常,异常信息如下:

    16-Jan-2018 16:33:37.325 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor C:UsersAdministrator.IntelliJIdea2017.1system omcatUnnamed_xxx_6confCatalinalocalhostAAA.xml

    16-Jan-2018 16:33:37.331 警告 [localhost-startStop-1] org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property.

    16-Jan-2018 16:33:37.336 严重 [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[/AAA]]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)

    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:621)

    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1835)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1f063757]

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)

    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4969)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5102)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

    ... 10 more

    Caused by: java.lang.IllegalArgumentException: The main resource set specified [G:AAA] is not valid

    at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:746)

    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:704)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

    ... 13 more

     

    16-Jan-2018 16:33:37.338 严重 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying configuration descriptor C:UsersAdministrator.IntelliJIdea2017.1system omcatUnnamed_xxx_6confCatalinalocalhostAAA.xml

     java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/AAA]]

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:757)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)

    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:621)

    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1835)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

    at java.lang.Thread.run(Thread.java:745)

     

      网上各种答案:1tomcatjdk版本不匹配;2maven版本冲突;3web.zml中配置错误;4tomcat有缓存.........我都尝试了都没有解决我的问题。

      由于我在tomcat中配置了虚拟路径(什么是虚拟路劲,怎么设置请看http://blog.csdn.net/zjml2412/article/details/49962939),就是在tomcat的安装目录confCatalinalocalhost下新建了一个配置文件AAA.xml文件,文件具体内容为:

        <?xml version="1.0" encoding="UTF-8"?>

        <Context docBase="G:/AAA" reloadable="true" debug="0" path="/AAA"/>

      其中G:/AAA”代表我的电脑磁盘的G盘有个AAA文件,tomcat在启动的时候会加载“G:/AAA”文件夹(文件),以便可以在网络上使用"/AAA"访问,所以说如果G盘没有AAA文件夹(文件),tomcat启动时会出现上面的异常。

      所以说出现上面的异常,1)如果你配置过虚拟路径,并且项目中要用到虚拟路径,那么请先在对应的”G”盘创建”AAA”文件;2)如果没有配置过虚拟路劲,出现上面的异常,你可以将confCatalinalocalhost的文件删除;实在不行,网上下载一个新的tomcat部署项目应该就好了。

    在全栈的道路上,积极向上、成熟稳重、谦虚好学、怀着炽热的心向前方的走得更远。
  • 相关阅读:
    JAVA单例MongoDB工具类
    Docker的安装使用-第1章
    JSON支持什么对象/类型?
    Linux环境源码编译安装SVN
    网站优化总结
    [java]反射1 2017-06-25 21:50 79人阅读 评论(10) 收藏
    记一次问题的解决,web自动化用例的管理
    将GatlingBundle容器化,并通过参数化来执行压测
    基于Fitnesse的接口自动化测试-关键字设计-样例-mysql操作
    基于Fitnesse的接口自动化测试-关键字设计-样例-redis操作
  • 原文地址:https://www.cnblogs.com/DDgougou/p/8483574.html
Copyright © 2011-2022 走看看