Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/368.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Tomcat上部署Webapp时出错_Java_Tomcat - Fatal编程技术网

Java 在Tomcat上部署Webapp时出错

Java 在Tomcat上部署Webapp时出错,java,tomcat,Java,Tomcat,我在tomcat上部署webapp时遇到一些问题。我一直得到以下错误 SEVERE: Error deploying web application archive /var/lib/tomcat7/webapps/SadScary.war java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start c

我在tomcat上部署webapp时遇到一些问题。我一直得到以下错误

SEVERE: Error deploying web application archive /var/lib/tomcat7/webapps/SadScary.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed         to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SadScary]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:541)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1461)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1445)
    at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:301)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:208)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
知道是什么导致了这个异常吗?我已经检查并重新检查了web xml和servlet映射,没有发现任何错误

任何帮助都将不胜感激

编辑。。这是我的web.xml

<?xml version="1.0" encoding="utf-8"?>
<web-app version="3.0" id="WebApp_ID"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<display-name>SadScary</display-name>
<listener>
  <listener-class>
  com.example.reelchatterap.StartupListener</listener-class>
</listener>
<welcome-file-list>
  <welcome-file>index.html</welcome-file>
  <welcome-file>index.htm</welcome-file>
  <welcome-file>index.jsp</welcome-file>
  <welcome-file>default.html</welcome-file>
  <welcome-file>default.htm</welcome-file>
  <welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
  <description>Reviews Database</description>
  <res-ref-name>jdbc/myTestDB</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>
<servlet>
  <servlet-name>UpdateList</servlet-name>
  <servlet-class>
  com.example.reelchatterap.UpdateList</servlet-class>
</servlet>-
<servlet-mapping>
  <servlet-name>UpdateList</servlet-name>
  <url-pattern>/UpdateList</url-pattern>
</servlet-mapping></web-app>

可怕的
com.example.reelchatterap.StartupListener
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
评论数据库
jdbc/myTestDB
javax.sql.DataSource
容器
更新列表
com.example.reelchatterap.UpdateList
-
更新列表
/更新列表

您检查日志了吗?查看logs/catalina.out并为我们提供一些其他信息:)嗨,谢谢你回复我。以上内容摘自日志。谢谢。不幸的是,此错误只是表明web.xml文件配置错误。也许发布您的web.xml可以帮助我们解决这个问题。谢谢BelgianMyWaffle。我现在将编辑以包含我的web.xml。