org.xml.sax. SAXParseException: Element type "web-app" must be declared.
Sometime you will notice these kinds of error messsges while deploying your web application to Tomcat.
org.apache.commons.digester.Digester - Parse Error at line 22 column 18: Element type "web-app" must be declared.
org.xml.sax.SAXParseException: Element type "web-app" must be declared.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(XMLValidator.java:1807)
at org.apache.xerces.validators.common.XMLValidator.validateElementAndAttributes(XMLValidator.java:3633)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1229)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3587)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
at org.apache.catalina.startup.Embedded.start(Embedded.java:994)
It is caused due to the compatibility problem between the Tomcat version and web.xml version.
In my case Tomcat 4 does not support version 2.4 of web.xml .So i have changed the web.xml to look like this (to comply with 2.3)
<!DOCTYPE
web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">< web-app>
and it worked for me....
Comments
Post a Comment