未加载Tomcat on spring

时间:2016-12-14 06:23:47

标签: java spring tomcat

我正在eclipse上工作。当我运行我的服务器时,它显示错误如下:

错误:

  

java.util.concurrent.ExecutionException:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [卡塔利娜] .StandardHost [本地主机] .StandardContext [/ SpringMVCAnnotationSecurity]]     在java.util.concurrent.FutureTask.report(未知来源)at   java.util.concurrent.FutureTask.get(未知来源)at   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939)     在   org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1419)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1409)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [卡塔利娜] .StandardHost [本地主机] .StandardContext [/ SpringMVCAnnotationSecurity]]     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)     ... 6更多引起:org.apache.catalina.LifecycleException:失败   开始组件   [org.apache.catalina.webresources.StandardRoot@7d8d6983] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)     在   org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4842)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4974)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 6更多引起:org.apache.catalina.LifecycleException:失败   初始化组件   [org.apache.catalina.webresources.JarResourceSet@4889c18] at   org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)     在   org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:708)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 9更多引起:java.lang.IllegalArgumentException:   java.util.zip.ZipException:无效的LOC头(错误的签名)at   org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:113)     在   org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)     ... 12更多引起:java.util.zip.ZipException:无效的LOC标头   (错误的签名)在java.util.zip.ZipFile.read(Native Method)at   java.util.zip.ZipFile.access $ 1400(未知来源)at   java.util.zip.ZipFile $ ZipFileInputStream.read(未知来源)at   java.util.zip.ZipFile $ ZipFileInflaterInputStream.fill(Unknown Source)     在java.util.zip.InflaterInputStream.read(未知来源)at   sun.misc.IOUtils.readFully(未知来源)at   java.util.jar.JarFile.getBytes(未知来源)at   java.util.jar.JarFile.getManifestFromReference(Unknown Source)at   java.util.jar.JarFile.getManifest(未知来源)at   org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:111)     ......还有13个

     

2016年12月14日下午12:06:37 org.apache.jasper.servlet.TldScanner scanJars   信息:至少有一个JAR被扫描用于TLD但尚未包含TLD。   为此记录器启用调试日志记录,以获取完整的JAR列表   扫描但未发现TLD。跳过不需要的JAR   扫描期间可以缩短启动时间和JSP编译时间。十二月   14,2016 12:06:37 PM org.apache.catalina.core.ContainerBase   startInternal SEVERE:启动时子容器失败   java.util.concurrent.ExecutionException:   org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [Catalina] .StandardHost [localhost]] at   java.util.concurrent.FutureTask.report(未知来源)at   java.util.concurrent.FutureTask.get(未知来源)at   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:939)     在   org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.startup.Catalina.start(Catalina.java:655)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)at at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)导致   by:org.apache.catalina.LifecycleException:无法启动组件   [StandardEngine [Catalina] .StandardHost [localhost]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1419)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1409)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   org.apache.catalina.LifecycleException:子容器失败   在开始时   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)     在   org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有6个

     

2016年12月14日下午12:06:37 org.apache.catalina.startup.Catalina开始   严重:所需的服务器组件无法启动,因此Tomcat是   无法开始。 org.apache.catalina.LifecycleException:失败   启动组件[StandardServer [8005]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)     在org.apache.catalina.startup.Catalina.start(Catalina.java:655)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at   sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at   java.lang.reflect.Method.invoke(未知来源)at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)at at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)导致   by:org.apache.catalina.LifecycleException:无法启动组件   [StandardService [Catalina]] at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)     在   org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 7更多引起:org.apache.catalina.LifecycleException:失败   启动组件[StandardEngine [Catalina]]   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)     在   org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ... 9更多引起:org.apache.catalina.LifecycleException:一个孩子   容器在启动时失败   org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)     在   org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     ......还有11个

我的pom.xml是:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.o7.planning</groupId>
  <artifactId>SpringMVCAnnotationSecurity</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>SpringMVCAnnotationSecurity Maven Webapp</name>
  <url>http://maven.apache.org</url>


  <properties>
      <!-- Generic properties -->
      <java.version>1.7</java.version>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>


  <repositories>
      <!-- Repository for ORACLE JDBC Driver -->
      <repository>
          <id>codelds</id>
          <url>https://code.lds.org/nexus/content/groups/main-repo</url>
      </repository>
  </repositories>


  <dependencies>

  <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
          <version>4.2.5.RELEASE</version>
      </dependency>

    <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>2.24</version>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
        </dependency>
  </dependencies>
  <build>
    <finalName>SpringMVCAnnotationSecurity</finalName>
  </build>
</project>

问题出在哪里?

2 个答案:

答案 0 :(得分:0)

尝试删除服务器,然后再次添加新的tomcat服务器并运行它。对我来说这很有效。

答案 1 :(得分:0)

有时会有几个问题。在将新的依赖项添加到POM文件之后,maven下载了jar,如果由于某种原因而导致jar崩溃,则tomcat无法启动。

按照@Sangram Jadhav的建议,删除新下载的jar。或

如果不确定,请仅删除.m2文件夹。

此外,Tomcat也存在问题,在发生这种情况后它无法启动,因此请删除使用eclipse配置的Tomcat。再次设置。 tomcat将启动。

请先尝试执行此步骤,以便在Eclipse中重置Tomcat设置,否则从.m2删除jar或删除完整的.me文件夹。

希望这对某人有帮助。