it-swarm.com.ru

Не удалось запустить компонент [StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ LabWebServletHibernate]]

Я получаю эту ошибку при запуске приложения на Tomcat-8 с Eclipse neon-1, оно использует spring-4.3.3, hibernate-5.2.4 и 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 [[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)

вот мой 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>

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

Я рад поделиться любым другим источником, если это требуется, спасибо за любую помощь.

5
I. Lin

Кажется, что любая из jar-зависимостей вашего проекта повреждена. Вы можете попробовать удалить всю локальную папку репозитория Maven или, если вам удастся узнать, какая из них повреждена, просто удалите ее.

После одного из этих действий просто обновите зависимости maven, и он должен начать работать

17
jlumietu

Эта проблема может быть из-за того, что файлы jar, которые использует ваш проект, должны быть повреждены. Так как на моей машине были windows, я исправляю эту ошибку, перейдя по следующему пути

C: ///{имя пользователя} Пользователи /.m2/repository/

Удалив все файлы и папки в этом репозитории . Эти файлы будут загружены снова, и после перезапуска и очистки вашего рабочего пространства в Eclipse эта ошибка была устранена.

4
Ashwani Sharma

Когда вы используете Maven, не создавайте папку lib в WEB-INF, а добавьте тег зависимостей в pom.xml

0
princely amirthasamy

Та же проблема возникла, когда я удаляю зависимость в pom.xml. Затем я просто обновляю зависимость maven (щелкните правой кнопкой мыши Project -> Maven -> Update Project) и очищаю свой проект (project -> clean), но он не работает. Наконец, я просто удаляю проект с сервера Tomcat, а затем снова добавляю проект . Это работает!

0
alan9uo