web-dev-qa-db-fra.com

Impossible de démarrer le composant [StandardEngine [Catalina] .StandardHost [hôte local] .StandardContext [/ LabWebServletHibernate]]

Je reçois cette erreur lors de l'exécution de l'application sur Tomcat-8 avec Eclipse neon-1. Elle utilise spring-4.3.3, hibernate-5.2.4 et maven.

嚴重: 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 [org.Apache.catalina.webresources.StandardRoot@2b8b2271]
    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 [org.Apache.catalina.webresources.JarResourceSet@93d5fda]
    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)

voici mon 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>

et 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>

Je suis bon de partager toute autre source si nécessaire, merci pour toute aide.

5
I. Lin

Toutes les dépendances de jar de votre projet semblent être corrompues. Vous pouvez essayer de supprimer tout votre dossier Maven Repo local ou, si vous parvenez à savoir quel est le fichier corrompu, supprimez-le simplement.

Après l’une de ces actions, il suffit de mettre à jour les dépendances maven et cela devrait commencer à fonctionner.

17
jlumietu

Ce problème peut être dû au fait que les fichiers jar utilisés par votre projet doivent être corrompus. Comme ma machine était Windows, je corrige donc cette erreur en allant sur le chemin suivant

C: // Utilisateurs/{nom d'utilisateur}/.m2/repository/

En supprimant tous les fichiers et dossiers de ce référentiel, ces fichiers jar seront téléchargés à nouveau. Après le redémarrage et le nettoyage de votre espace de travail dans Eclipse, cette erreur a été résolue.

4
Ashwani Sharma

Lorsque vous utilisez Maven, ne créez pas de dossier lib sous WEB-INF, veuillez ajouter une balise de dépendance dans pom.xml.

0

Le même problème est apparu lorsque j'ai supprimé une dépendance dans pom.xml. Ensuite, je viens de mettre à jour la dépendance maven (cliquez avec le bouton droit sur Projet -> Maven -> Mettre à jour le projet) et nettoyez mon projet (projet -> nettoyer), cela n’a pas fonctionné. Enfin, je supprime simplement le projet du serveur Tomcat, puis rajoute le projet . Ça marche!

0
alan9uo