Eclipse neon-1を使用してTomcat-8でアプリを実行すると、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 [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)
ここに私の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>
必要に応じて他のソースを共有してもいいです。助けてくれてありがとう。
プロジェクトのjar依存関係のいずれかが破損しているようです。すべてのローカルMavenリポジトリフォルダーを削除してみることもできますが、破損したフォルダーを特定できる場合は、削除してください。
これらのアクションのいずれかの後、Mavenの依存関係を更新するだけで、動作を開始するはずです。
この問題は、プロジェクトで使用しているjarファイルが破損しているために発生した可能性があります。私のマシンはWindowsだったので、次のパスに移動してこのエラーを修正しました
C:// Users/{user-name} /.m2/repository/
このリポジトリ内のすべてのファイルとフォルダーを削除します。これらのjarは再度ダウンロードされ、Eclipseでワークスペースを再起動してクリーニングした後、このエラーは解決されました。
このケースもあなたにはわかりませんが、EclipseのApacheサーバーのクリーニングは完全にうまくいきました。プロセスの途中でサーバーのクリーンを停止したために発生しました。これでエラーが解決しました。サーバーをクリーニングしてみてください
次のinur Pomファイルを追加します
</properties>
<Tomcat.version>8.0.30</Tomcat.version>
</properties>
Mavenを使用している場合、WEB-INFの下にlibフォルダーを作成せず、代わりにpom.xmlに依存関係タグを追加してください
Pom.xmlで依存関係を削除すると、同じ問題が発生しました。次に、Mavenの依存関係を更新し([プロジェクト]-> [Maven]-> [プロジェクトの更新]を右クリック)、プロジェクトを削除します(プロジェクト->削除)、動作しませんでした。 最後に、Tomcatサーバーからプロジェクトを削除してから、プロジェクトを再度追加します。うまくいく!