You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/01/07 22:49:07 UTC

[Bug 55973] Failure to parse MergedWebXml when validation is enabled in Jasper

https://issues.apache.org/bugzilla/show_bug.cgi?id=55973

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> ---
The cause of this issue is that Jasper uses DOM parser, while the rest of
Tomcat code uses Apache Commons Digester.

When DOM parser is used directly, calling "factory.setValidating(validating);"
on DocumentBuilderFactory enables DOM validation only, but not the schema one.
(in ParserUtils.java in jasper)

When Digester is used, calling digester.setValidating(true) enables not only
DOM validation, but schema one as well.

See Digester#getFactory() for a fragment of code that enables schema
validation.


By the way, XmlErrorHandler used by Japser here stores the errors and warnings
in a HashSet. In this case, there are 2 errors, and which one is reported is
random, as the HashSet has no order. From debugger:

[org.xml.sax.SAXParseException: Document root element "web-app", must match
DOCTYPE root "null"., org.xml.sax.SAXParseException: Document is invalid: no
grammar found.]

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org