• springboot的war包在外部的tomcat发布出现org.apache.catalina.LifecycleException: Failed to start component


    1 出现的问题:

         在tomcat下发布出现org.apache.catalina.LifecycleException: Failed to start component

    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springboot2]]
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
    	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
    	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: java.lang.NoClassDefFoundError: org/apache/tomcat/util/descriptor/tld/TldParser
    	at org.apache.jasper.servlet.TldScanner.<init>(TldScanner.java:84)
    	at org.apache.jasper.servlet.JasperInitializer.newTldScanner(JasperInitializer.java:118)
    	at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:99)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    	... 10 more
    Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.descriptor.tld.TldParser
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
    	... 15 more
    
    九月 13, 2018 12:58:23 下午 org.apache.catalina.startup.HostConfig deployWAR
    严重: Error deploying web application archive D:apache-tomcat-7.0.47webappsspringboot2.war
    java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springboot2]]
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
    	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
    	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)

    2 原因:

      是因为pom.xml的servlet,jstl,jsp依赖缺少了scope标签

      

    3 解决的方法:

        在这三个依赖里面加上<scope>provided</scope>标签就可以,这样就不会依赖内置的jar了

  • 相关阅读:
    构造函数作为友元函数的参数
    引用调用
    分块查找
    折半查找
    c++中map按key和value排序
    STL之map学习实例
    STL之stack
    STL之map
    STL之string
    STL之template类模板
  • 原文地址:https://www.cnblogs.com/t0404/p/10290940.html
Copyright © 2020-2023  润新知