it-swarm.com.de

Fehler beim Starten der Komponente [StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ LabWebServletHibernate]]

Ich erhalte diesen Fehler, wenn ich die App auf Tomcat-8 mit Eclipse Neon-1 ausführte. Dabei wird Spring-4.3.3, Hibernate-5.2.4 und Maven verwendet.

嚴重: A child container failed during start
Java.util.concurrent.ExecutionException: org.Apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/LabWebServletHibernate]]
    at Java.util.concurrent.FutureTask.report(Unknown Source)
    at Java.util.concurrent.FutureTask.get(Unknown Source)
    at org.Apache.catalina.core.ContainerBase.startInternal(ContainerBase.Java:915)
    at org.Apache.catalina.core.StandardHost.startInternal(StandardHost.Java:871)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1407)
    at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1397)
    at Java.util.concurrent.FutureTask.run(Unknown Source)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at Java.lang.Thread.run(Unknown Source)
Caused by: org.Apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/LabWebServletHibernate]]
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:162)
    ... 6 more
Caused by: org.Apache.catalina.LifecycleException: Failed to start component [[email protected]]
    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:5099)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    ... 6 more
Caused by: org.Apache.catalina.LifecycleException: Failed to initialize component [[email protected]]
    at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:107)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:135)
    at org.Apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.Java:706)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    ... 9 more
Caused by: Java.lang.IllegalArgumentException: Java.util.Zip.ZipException: invalid LOC header (bad signature)
    at org.Apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.Java:113)
    at org.Apache.catalina.util.LifecycleBase.init(LifecycleBase.Java:102)
    ... 12 more
Caused by: Java.util.Zip.ZipException: invalid LOC header (bad signature)
    at Java.util.Zip.ZipFile.read(Native Method)
    at Java.util.Zip.ZipFile.access$1400(Unknown Source)
    at Java.util.Zip.ZipFile$ZipFileInputStream.read(Unknown Source)
    at Java.util.Zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
    at Java.util.Zip.InflaterInputStream.read(Unknown Source)
    at Sun.misc.IOUtils.readFully(Unknown Source)
    at Java.util.jar.JarFile.getBytes(Unknown Source)
    at Java.util.jar.JarFile.getManifestFromReference(Unknown Source)
    at Java.util.jar.JarFile.getManifest(Unknown Source)
    at org.Apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.Java:111)
    ... 13 more

十一月 18, 2016 5:19:25 下午 org.Apache.catalina.core.ContainerBase startInternal
嚴重: A child container failed during start
Java.util.concurrent.ExecutionException: org.Apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at Java.util.concurrent.FutureTask.report(Unknown Source)
    at Java.util.concurrent.FutureTask.get(Unknown Source)
    at org.Apache.catalina.core.ContainerBase.startInternal(ContainerBase.Java:915)
    at org.Apache.catalina.core.StandardEngine.startInternal(StandardEngine.Java:262)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    at org.Apache.catalina.core.StandardService.startInternal(StandardService.Java:441)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    at org.Apache.catalina.core.StandardServer.startInternal(StandardServer.Java:787)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    at org.Apache.catalina.startup.Catalina.start(Catalina.Java:629)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at Java.lang.reflect.Method.invoke(Unknown Source)
    at org.Apache.catalina.startup.Bootstrap.start(Bootstrap.Java:351)
    at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:485)
Caused by: org.Apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:162)
    at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1407)
    at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1397)
    at Java.util.concurrent.FutureTask.run(Unknown Source)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at Java.lang.Thread.run(Unknown Source)
Caused by: org.Apache.catalina.LifecycleException: A child container failed during start
    at org.Apache.catalina.core.ContainerBase.startInternal(ContainerBase.Java:923)
    at org.Apache.catalina.core.StandardHost.startInternal(StandardHost.Java:871)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    ... 6 more

十一月 18, 2016 5:19:25 下午 org.Apache.catalina.startup.Catalina start
嚴重: The required Server component failed to start so Tomcat is unable to start.
org.Apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:162)
    at org.Apache.catalina.startup.Catalina.start(Catalina.Java:629)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at Java.lang.reflect.Method.invoke(Unknown Source)
    at org.Apache.catalina.startup.Bootstrap.start(Bootstrap.Java:351)
    at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:485)
Caused by: org.Apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:162)
    at org.Apache.catalina.core.StandardServer.startInternal(StandardServer.Java:787)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    ... 7 more
Caused by: org.Apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:162)
    at org.Apache.catalina.core.StandardService.startInternal(StandardService.Java:441)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    ... 9 more
Caused by: org.Apache.catalina.LifecycleException: A child container failed during start
    at org.Apache.catalina.core.ContainerBase.startInternal(ContainerBase.Java:923)
    at org.Apache.catalina.core.StandardEngine.startInternal(StandardEngine.Java:262)
    at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:145)
    ... 11 more

嚴重: Failed to destroy end point associated with ProtocolHandler ["http-nio-8080"]
Java.lang.NullPointerException
    at org.Apache.Tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.Java:316)
    at org.Apache.Tomcat.util.net.NioEndpoint.unbind(NioEndpoint.Java:492)
    at org.Apache.Tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.Java:821)
    at org.Apache.coyote.AbstractProtocol.destroy(AbstractProtocol.Java:551)
    at org.Apache.catalina.connector.Connector.destroyInternal(Connector.Java:1023)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.StandardService.destroyInternal(StandardService.Java:589)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.StandardServer.destroyInternal(StandardServer.Java:877)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.startup.Catalina.start(Catalina.Java:633)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at Java.lang.reflect.Method.invoke(Unknown Source)
    at org.Apache.catalina.startup.Bootstrap.start(Bootstrap.Java:351)
    at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:485)

十一月 18, 2016 5:19:25 下午 org.Apache.coyote.AbstractProtocol destroy
資訊: Destroying ProtocolHandler ["ajp-nio-8009"]
十一月 18, 2016 5:19:25 下午 org.Apache.coyote.AbstractProtocol destroy
嚴重: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
Java.lang.NullPointerException
    at org.Apache.Tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.Java:316)
    at org.Apache.Tomcat.util.net.NioEndpoint.unbind(NioEndpoint.Java:492)
    at org.Apache.Tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.Java:821)
    at org.Apache.coyote.AbstractProtocol.destroy(AbstractProtocol.Java:551)
    at org.Apache.catalina.connector.Connector.destroyInternal(Connector.Java:1023)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.StandardService.destroyInternal(StandardService.Java:589)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.StandardServer.destroyInternal(StandardServer.Java:877)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.startup.Catalina.start(Catalina.Java:633)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at Java.lang.reflect.Method.invoke(Unknown Source)
    at org.Apache.catalina.startup.Bootstrap.start(Bootstrap.Java:351)
    at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:485)

十一月 18, 2016 5:19:25 下午 org.Apache.catalina.deploy.NamingResourcesImpl cleanUp
警告: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/LabWebServletHibernate]] so no cleanup was performed for that container
javax.naming.NamingException: No naming context bound to this class loader
    at org.Apache.naming.ContextBindings.getClassLoader(ContextBindings.Java:258)
    at org.Apache.catalina.deploy.NamingResourcesImpl.cleanUp(NamingResourcesImpl.Java:992)
    at org.Apache.catalina.deploy.NamingResourcesImpl.stopInternal(NamingResourcesImpl.Java:975)
    at org.Apache.catalina.util.LifecycleBase.stop(LifecycleBase.Java:221)
    at org.Apache.catalina.core.StandardContext.stopInternal(StandardContext.Java:5551)
    at org.Apache.catalina.util.LifecycleBase.stop(LifecycleBase.Java:221)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:259)
    at org.Apache.catalina.core.ContainerBase.removeChild(ContainerBase.Java:832)
    at org.Apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.Java:1012)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.ContainerBase.removeChild(ContainerBase.Java:832)
    at org.Apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.Java:1012)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.StandardService.destroyInternal(StandardService.Java:604)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.core.StandardServer.destroyInternal(StandardServer.Java:877)
    at org.Apache.catalina.util.LifecycleBase.destroy(LifecycleBase.Java:292)
    at org.Apache.catalina.startup.Catalina.start(Catalina.Java:633)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at Java.lang.reflect.Method.invoke(Unknown Source)
    at org.Apache.catalina.startup.Bootstrap.start(Bootstrap.Java:351)
    at org.Apache.catalina.startup.Bootstrap.main(Bootstrap.Java:485)

hier ist meine web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <display-name>LabWebServletHibernate</display-name>

    <resource-ref>
        <res-ref-name>jdbc/xxx</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Unshareable</res-sharing-scope>
    </resource-ref>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/beans.config.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <filter-class>model.misc.OpenSessionInViewFilter</filter-class>
        <init-param>
            <param-name>sessionFactoryBeanName</param-name>
            <param-value>sessionFactory</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

</web-app>

und beans.config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">


    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="Java:comp/env/jdbc/xxx"></property>
    </bean>

    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"></property>
        <property name="configLocation" value="classpath:hibernate.cfg.xml"></property>
        <!-- <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> 
            <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.current_session_context_class">thread</prop> 
            </props> </property> <property name="annotatedClasses"> <array> <value>model.CustomerBean</value> 
            <value>model.ProductBean</value> </array> </property> -->
    </bean>
    <context:annotation-config></context:annotation-config>
    <context:component-scan base-package="model"></context:component-scan>
</beans>

Ich kann anderen Quellen gerne mitteilen, wenn es erforderlich ist. Danke für jede Hilfe.

5
I. Lin

Alle Jar-Abhängigkeiten Ihres Projekts scheinen beschädigt zu sein. Sie könnten versuchen, alle lokalen Repository-Ordner für Maven zu löschen. Wenn Sie herausfinden möchten, welcher der beschädigte Ordner ist, löschen Sie ihn einfach.

Aktualisieren Sie nach einer dieser Aktionen nur die Abhängigkeiten von Maven, und es sollte funktionieren

17
jlumietu

Dieses Problem kann darauf zurückzuführen sein, dass die JAR-Dateien, die Ihr Projekt verwendet, beschädigt sein müssen. Da mein Computer Windows war, behebe ich diesen Fehler, indem ich zum folgenden Pfad gehe

C: // Benutzer/{Benutzername} /.m2/repository/

Durch Löschen aller Dateien und Ordner in diesem Repository werden diese Gläser erneut heruntergeladen. Nach dem Neustart und dem Reinigen des Arbeitsbereichs in Eclipse wurde dieser Fehler behoben.

4
Ashwani Sharma

Wenn Sie Maven verwenden, erstellen Sie keinen lib-Ordner unter WEB-INF, sondern fügen Sie in pom.xml das Abhängigkeits-Tag hinzu

Dasselbe Problem trat auf, wenn ich eine Abhängigkeit in pom.xml lösche. Dann aktualisiere ich einfach die Maven-Abhängigkeit (Rechtsklick auf Projekt -> Maven -> Projekt aktualisieren) und bereinige mein Projekt (Projekt -> Bereinigen), funktionierte nicht. Zum Schluss entferne ich einfach das Projekt vom Tomcat-Server und füge das Projekt dann erneut hinzu . Es funktioniert!

0
alan9uo