Why do I get the error. org.xml.sax.SAXParseException : Element type "web-app" must be declared. when starting my web application? It has a web-app element already!

Alessandro A. Garbagnati

The XML DOCTYPE headers are missing from your web.xml file.

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
Or...Is WEB-INF all capital case (sorry if I ask you this question, but this could be one cause of the problem).

[Note that this error would not cause a problem in some older servlet engines. Specifically, I'm pretty sure Tomcat 3 was not so strict. This is a "gotcha" when upgrading from Tomcat 3 to Tomcat 4. -Alex C]

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact