我正在学习在实施时做宁静的网络服务我得到以下错误帮助我解决

Posted

技术标签:

【中文标题】我正在学习在实施时做宁静的网络服务我得到以下错误帮助我解决【英文标题】:am learning to do restful web services while implementing i got following error help me to resolve 【发布时间】:2016-07-17 23:20:06 【问题描述】:

源代码和异常截图:

SEVERE: 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:1120)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:444)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:738)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.startup.Catalina.start(Catalina.java:693)
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:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
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:1128)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 more

Mar 30, 2016 10:38:42 AM org.apache.catalina.startup.Catalina start
SEVERE: 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:153)
at org.apache.catalina.startup.Catalina.start(Catalina.java:693)
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:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:738)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:444)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1128)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 11 more

配置文件web.xml的截图:

【问题讨论】:

应该是你设置的问题。穿上它,否则没有人可以帮助你。 请在代码中添加stackTrace 请提供引发此异常的 Java 代码并描述在什么情况下引发异常。 一般情况下,请避免截图并将内容粘贴为文本... 【参考方案1】:

当 Eclipse 的 JRE 版本与 Tomcat 不兼容时会出现此异常。 解决方案- 将 Eclipse 之一更改为 Tomcat,反之亦然。 您可以通过查看 tomcat startup.bat 文件来检查 JAVA_HOME。

【讨论】:

我用的是jre 1.8.0_45版,请问能介绍一下tomcat的兼容版本吗?

以上是关于我正在学习在实施时做宁静的网络服务我得到以下错误帮助我解决的主要内容,如果未能解决你的问题,请参考以下文章

Laravel 完整性约束错误未在控制器中返回 JSON

宁静服务的路由策略

我正在离线的网页上学习 Paypal 实施

“/literal/param/literal”是 WCF 宁静服务的有效 url 模板吗

设计一个宁静的服务

Google Play 游戏服务警报:“检测到错误的实施”