It's not a secret anymore!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes error in web.xml (Tomcat) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "error in web.xml (Tomcat)" Watch "error in web.xml (Tomcat)" New topic

error in web.xml (Tomcat)

Anjuga Selvan

Joined: Mar 24, 2005
Posts: 1
Hi all,
I tried to deploy a web app using Deployment Descriptor for the first time. When starting the server i am getting an error -"org.xml.sax.SAXParseException: Element type "web-app" must be declared."

The following is what i have in my web.xml. I am using Tomcat4.0.1 and jdk1.3. What might be the problem and what is the solution ? Can anyone plz help me in this regard?

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

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<web-app xmlns=""
xsi:schemaLocation="" version="2.4">
// DD elements go here.


Thanks in advance,
Bassam Zahid
Ranch Hand

Joined: Mar 09, 2005
Posts: 61
First of all please upgrade your Tomcat and JDK version.

On Tomcat 4.x you cannot use Servlet 2.4 and JSP 2.0 specification.

BS<br />SCJP 1.4 88%<br />SCWCD 1.4 86%
I agree. Here's the link:
subject: error in web.xml (Tomcat)
It's not a secret anymore!