Bug 3870

Summary: Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
Product: Tomcat 3 Reporter: David J. hay <dhay>
Component: UnknownAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 3.3 Release Candidate 1   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description David J. hay 2001-09-28 10:09:35 UTC
Have just upgraded to 3.3 rc1, and get the following occasional message:

2001-09-27 16:31:00 - Ctx(/gwp) : Compiling: /serialNos.jsp to serialNos_19
Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired.  Parser will use a default
ErrorHandler to print the first 10 errors.  Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=42: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=51: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=60: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=71: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=77: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=86: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=95: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=105: Element "web-app" does not allow "welcome-file-list" h
ere.
Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired.  Parser will use a default
ErrorHandler to print the first 10 errors.  Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=42: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=51: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=60: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=71: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=77: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=86: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=95: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=105: Element "web-app" does not allow "welcome-file-list" h
ere.
Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired.  Parser will use a default
ErrorHandler to print the first 10 errors.  Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=42: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=51: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=60: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=71: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=77: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=86: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=95: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=105: Element "web-app" does not allow "welcome-file-list" h
ere.
Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired.  Parser will use a default
ErrorHandler to print the first 10 errors.  Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=42: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=51: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=60: Element "web-app" does not allow "servlet" here.
Error: URI=null Line=71: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=77: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=86: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=95: Element "web-app" does not allow "servlet-mapping" here
.
Error: URI=null Line=105: Element "web-app" does not allow "welcome-file-list" h
ere.

Haven't done anything different, so presume this is a bug!

Cheers,

David
Comment 1 David J. hay 2001-09-28 11:40:03 UTC
Further investigation reveals that this seems to occur every time tomcat 
compiles a jsp
Comment 2 william.barker 2001-09-28 12:00:42 UTC
Tomcat 3.2x allowed only well-formed web.xml files.  By default, 3.3 requires 
the web.xml to be valid (e.g. all elements must be in the order specified in 
the DTD).  You can disable this by setting validate="false" in the WebXmlReader 
element of server.xml, but I'd recommend fixing the web.xml file (since this is 
the only way to be portable to other containers).
Comment 3 Costin Manolache 2001-09-28 21:28:26 UTC
Reopen to mark as fixed.
Comment 4 Costin Manolache 2001-09-28 21:29:16 UTC
Added better messages, and an ErrorHandler.
You can disable validation by settings in WebXmlReader, or fix your xml file.