Hi List,

this is a simple issue i stumbled upon today. I just wanted to add a Servlet Filter to 
my Web Application today, but it did not validate the web.xml, but i was sure i got it 
right.

After all, i found the error to be the wrong DTD included in the web.xml-File of the 
Turbine TDK 2.3_01 i use. Maybe this saves someone around half an hour of questioning 
yourself what you did wrong.

https://list.unm.edu/cgi-bin/wa?A2=ind0310&L=jasig-portal&F=&S=&P=25153

The Exception was:

2004-06-21 14:01:19,242 ERROR [main] (Digester.java:1439) - Parse Error at line 50 
column 11: The content of element type "web-app" must match 
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
org.xml.sax.SAXParseException: The content of element type "web-app" must match 
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".

at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)


The Solution was to replace the 2.2 in the XML DTD Part of the web.xml-File with 2.3:


<?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/j2ee/dtds/web-app_2.3.dtd";>

And cheeers, the filter works.

Have a nice day,
martin

Reply via email to