Document is invalid: no grammar found. at (null:3:8)

严重: Document is invalid: no grammar found. at (null:3:8)
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
省略....

 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2012-8-17 15:37:11 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
file:/D:/Tomcat%206.0/webapps/Struts2UserLogin/WEB-INF/classes/struts.xml:3:8
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
省略... 

 Caused by: Document is invalid: no grammar found. - file:/D:/Tomcat%206.0/webapps/Struts2UserLogin/WEB-INF/classes/struts.xml:3:8
 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
 ... 34 more
Caused by: org.xml.sax.SAXParseException: Document is invalid: no grammar found.
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)

省略...

 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:121)
 ... 35 more
2012-8-17 15:37:11 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2012-8-17 15:37:11 org.apache.catalina.core.StandardContext start
严重: Context [/Struts2UserLogin] startup failed due to previous errors
2012-8-17 15:37:11 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2012-8-17 15:37:11 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2012-8-17 15:37:11 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/30  config=null
2012-8-17 15:37:11 org.apache.catalina.startup.Catalina start
信息: Server startup in 1758 ms

struts.xml配置文件内容如下

    

 
 
 
 
   
   
     
      success.html
   

 

 因为在struts.xml文件中缺少了DOCTYPT定义,在文件中加入
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

即可,正确的配置文件如下:

    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    

 
 
 
 
   
   
     
      success.html
   

 


你可能感兴趣的:(Struts2,Exception)