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 2006/09/14 10:01:23 UTC

DO NOT REPLY [Bug 40507] New: - XML validation fails when

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507

           Summary: XML validation fails when
           Product: Tomcat 5
           Version: 5.5.17
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: roland_nygren@msn.com


I Downloaded and installed Tomcat 5.5.17.
The only change I made was  xmlValidation="true" in server.xml
Same result on both:
 - RedHat EL 3, Java 1.5.0_08-b03
 - Windows XP, Java 1.5.0_06-b05

catalina.out:

INFO: XML validation enabled
2006-sep-14 09:51:01 org.apache.tomcat.util.digester.Digester error
ALLVARLIG: Parse Error at line 5 column 19: cvc-elt.1: Cannot find the
declaration of element 'web-app'.
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element
'web-app'.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
        at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:798)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1157)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
        at
org.apache.catalina.startup.ContextConfig.processDefaultWebConfig(ContextConfig.java:676)
        at
org.apache.catalina.startup.ContextConfig.defaultWebConfig(ContextConfig.java:613)
        at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1033)
        at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:260)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4119)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
        at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507





------- Additional Comments From chris@sourcelabs.com  2006-12-28 09:27 -------
RE #3:

You are quite correct.  I came to the same conclusion this morning when looking
at this again.  Turns out my last test yesterday was mistakenly against an
instance that I had cleaned out (no webapps deployed).  That's what I get for
having too many test instances around ;-)

The two cuplrits are indeed the host-manager and servlets-examples webapps. 
They still reference 2.3 DTDs in their deployment descriptors.

Since TC5.5 is a Servlet 2.4 container, it seems to follow that all of the
webapps in the default install should use the 2.4 xsd reference.  I'm attaching
patches to the servlets-examples and host-manager deployment descriptors that
make that update.  The deployment descriptor for the servlets-examples webapp
also needed some changes to be 2.4 schema conformant (env-entry subelement
ordering).  With these changes I can now start 5.5.20 error-free with validation
enabled.

It will still throw errors if it encounters a webapp with a 2.3 DTD reference. 
I haven't tracked that down yet.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507


roland_nygren@msn.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|XML validation fails when   |XML validation fails when
                   |                            |xmlValidation="true"




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507





------- Additional Comments From roland_nygren@msn.com  2006-12-28 05:14 -------
(In reply to comment #1)
> When you enable xmlValidation="true" you also need to enable
> xmlNamespaceAware="true" as well.  If these are both set to true in your
> server.xml you should be able to validate correctly.  Works for me anyway.

I don't know what I do wrong.
The same occurs with Tomcat 5.5.20.
Setting both xmlValidation & xmlNamespaceAware true I still get:

INFO: XML validation enabled
2006-dec-28 14:04:45 org.apache.tomcat.util.digester.Digester error
ALLVARLIG: Parse Error at line 7 column 10: cvc-elt.1: Cannot find the 
declaration of element 'web-app'.
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of 
element 'web-app'.
	at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseExcep
tion(ErrorHandlerWrapper.java:236)

...

2006-dec-28 14:04:45 org.apache.catalina.startup.ContextConfig start
ALLVARLIG: Marking this application unavailable due to previous error(s)
2006-dec-28 14:04:45 org.apache.catalina.core.StandardContext start
ALLVARLIG: Error getConfigured
2006-dec-28 14:04:45 org.apache.catalina.core.StandardContext start
ALLVARLIG: Context [/host-manager] startup failed due to previous errors

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507





------- Additional Comments From chris@sourcelabs.com  2006-12-28 09:38 -------
Created an attachment (id=19317)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19317&action=view)
Patch to update host-manager webapp to use servlet 2.4 xsd


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From markt@apache.org  2007-01-20 08:40 -------
Thanks for the patches. I have applied them to svn and they will be include din
5.5.21 onwards.

I have also been back through the mailing lists looks like the 2.3 validation
issues are caused by a bug in the xerces version used in the jvm. It is still
present in 1.5.0_10 and 1.6.0 but if you place the xerces jars included in the
5.5.x compat download in common/endorsed then they will be used instead and 2.3
webapps will validate successfully.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507


bugzilla@schoenhaber.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
            Version|5.5.17                      |5.5.20




------- Additional Comments From bugzilla@schoenhaber.de  2006-12-28 07:04 -------
I've just tested this and could reproduce the error using Tomcat 5.5.17 and
5.5.20 with "xmlValidation" and "xmlNamespaceAware" set to "true".

To me, it seems that this problem occurs only for 2.3 webapps (i. e. validating
against the servlet 2.3 DTD fails), while everything is fine with 2.4 webapps
(i. e. validating against the 2.4 schema works).
Can you verify that it's the same for you? Check that of the stock webapps that
come with Tomcat "host-manager" and "servlets-examples" (which are 2.3 webapps)
are not started while "balancer", "jsp-examples", "manager", "tomcat-docs" and
"webdav" (which are 2.4 webapps) are running.

I've changed the severity of this bug to minor. Since although I think that this
is a bug, I don't think that verifying the correctness of web.xml is a matter of
deployment but it's a matter of development. I. e. when developing a webapp it
should be made sure that web.xml is correct, making another check during
deployment quite pointless.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507





------- Additional Comments From chris@sourcelabs.com  2006-12-27 15:33 -------
When you enable xmlValidation="true" you also need to enable
xmlNamespaceAware="true" as well.  If these are both set to true in your
server.xml you should be able to validate correctly.  Works for me anyway.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 40507] - XML validation fails when xmlValidation="true"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40507>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40507





------- Additional Comments From chris@sourcelabs.com  2006-12-28 09:40 -------
Created an attachment (id=19318)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19318&action=view)
Patch to update servlets-examples webapp to use servlet 2.4 xsd


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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