tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29936] - XML parser loading problems by container
Date Thu, 07 Jun 2007 19:15:02 GMT
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=29936>.
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=29936


ecapachedev@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ecapachedev@gmail.com
             Status|RESOLVED                    |REOPENED
          Component|Unknown                     |Catalina
         Resolution|INVALID                     |




------- Additional Comments From ecapachedev@gmail.com  2007-06-07 12:15 -------
This issue is also prevalent in 5.5.x.  To reproduce, do the following:

1) Remove all stock webapps that come with the standard installation.  This
includes the ones in server/webapps.  Remember to remove the configurations in
conf/Catalina.
2) Add a webapp that has a saxon parser located in WEB-INF/lib.  For instance,
one from sourceforge.
3) Start Tomcat.  You should a stack trace similar to this:

Jun 7, 2007 11:33:29 AM org.apache.commons.digester.Digester getParser
SEVERE: Digester.getParser: 
javax.xml.parsers.ParserConfigurationException: AElfred parser is namespace-aware
	at
com.icl.saxon.aelfred.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:37)
	at org.apache.commons.digester.Digester.getParser(Digester.java:686)
	at org.apache.commons.digester.Digester.getXMLReader(Digester.java:902)
	at org.apache.commons.digester.Digester.parse(Digester.java:1548)
	at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:623)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
	at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
	at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
	at org.apache.catalina.core.StandardService.start(StandardService.java:480)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
	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:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Jun 7, 2007 11:33:29 AM org.apache.catalina.startup.ContextConfig defaultConfig
SEVERE: Parse error in default web.xml
java.lang.NullPointerException
	at org.apache.commons.digester.Digester.getXMLReader(Digester.java:902)
	at org.apache.commons.digester.Digester.parse(Digester.java:1548)
	at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:623)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
	at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
	at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
	at org.apache.catalina.core.StandardService.start(StandardService.java:480)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
	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:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

I believe the issue here is that when the Digester to parse web.xml is set in
ContextConfig, the path to WEB-INF/lib is established for the WebappClassloader.
 When the SAXParserFactory is created with newInstance() within the call to
Digester.getParser(), the rules dictate that it will search thirdmost for a file
META-INF/services/javax.xml.parsers.SAXParserFactory in jars available, and it
will find it in saxon.jar, prior to defaulting to a platform default parser. 
This webapp parser is now used for parsing the web.xml file, but since this task
is the container's responsibility, it should not be used.  As a note, this
particular parser needs to be namespace-aware and the setting of it being not
namespace-aware throws this exception.

A possible solution is to load the (default) parser into the Digester prior to
having it being loaded by the WebappClassloader.  Since this appears to be
one-time settable, it will use this parser regardless of what the webapp has.

-- 
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


Mime
View raw message