一尘不染

失败-无法启动上下文路径/ Hello中的应用程序

tomcat

我正在尝试在Tomcat 6.0中部署新的Web应用程序,但是每当我单击“开始”按钮时,我就反复 失败-无法在上下文路径/ Hello中启动应用程序
。每当我单击“开始”按钮时,其他已部署的应用程序运行良好。但是为什么不使用该应用程序呢?

网络XML:

 <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

<servlet>
<servlet-name>j_security_check</servlet-name>
<servlet-class>EmailHander</servlet-class>
</servlet>

<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/fail_login.html</form-error-page>
</form-login-config>
</login-config>
<web-app>

这是我在catalina日志文件中遇到的异常:

Jan 23, 2010 6:49:31 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/Hello/WEB-INF/web.xml
org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1066)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4339)
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1249)
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:612)
    at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)

web-xml文件中该错误的原因是什么?


阅读 2146

收藏
2020-06-16

共1个答案

一尘不染

您的web.xml结尾为<web-app>,但必须结尾为</web-app>

顺便 一下,这几乎 异常告诉您的内容。

2020-06-16