You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Haraburda <da...@dairy.com> on 2010/01/04 18:43:04 UTC
Weird JAXP problem at Tomcat startup
Sometimes, when starting Tomcat I get an error when JAXP is trying to
load the DocumentBuilderFactory. Tomcat does not start completely. This
doesn't always happen, and when it does I can restart the server and it
is fine. I turned on JAXP debugging and noticed that when I had the
problem, JAXP was finding a system property specifying that xerces
should be used:
INFO: Starting Coyote HTTP/1.1 on http-8580
JAXP: find factoryId =javax.xml.parsers.DocumentBuilderFactory
JAXP: found system property,
value=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:24
0)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFact
ory.java:129)
at
org.apache.commons.modeler.util.DomUtil.readXml(DomUtil.java:242)
at
org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.execute(Mb
eansDescriptorsDOMSource.java:88)
at
org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.loadDescri
ptors(MbeansDescriptorsDOMSource.java:78)
at org.apache.commons.modeler.Registry.load(Registry.java:792)
at
org.apache.commons.modeler.Registry.loadDescriptors(Registry.java:901)
at
org.apache.commons.modeler.Registry.loadDescriptors(Registry.java:882)
at
org.apache.commons.modeler.Registry.findDescriptor(Registry.java:961)
at
org.apache.commons.modeler.Registry.findManagedBean(Registry.java:666)
at
org.apache.commons.modeler.Registry.findManagedBean(Registry.java:1015)
at
org.apache.commons.modeler.Registry.registerComponent(Registry.java:832)
at
org.apache.catalina.connector.Connector.start(Connector.java:1077)
at
org.apache.catalina.core.StandardService.start(StandardService.java:457)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
... 12 more
When Tomcat loads fine, it appears that system property is not set and
it is (successfully) falling back on the default:
INFO: Initializing Coyote HTTP/1.1 on http-8580
Jan 4, 2010 8:58:29 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 460 ms
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value:
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using
ClassLoader: null
Jan 4, 2010 8:58:29 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 4, 2010 8:58:29 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.28
I have only one webapp in this instance of Tomcat. It does have xerces
JARs in its WEB-INF/lib directory, but of course Tomcat doesn't look
there when it is loading. I can't figure out how the system property is
being set.
I am using Tomcat 5.5.28, Java 1.6.0_07 64-bit on Oracle Linux (RHEL)
5.2.
Any help is appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Weird JAXP problem at Tomcat startup
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: David Haraburda [mailto:david.haraburda@dairy.com]
> Subject: Weird JAXP problem at Tomcat startup
>
> I turned on JAXP debugging and noticed that when I had the
> problem, JAXP was finding a system property specifying that
> xerces should be used:
>
> INFO: Starting Coyote HTTP/1.1 on http-8580
> JAXP: find factoryId =javax.xml.parsers.DocumentBuilderFactory
> JAXP: found system property,
> value=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
>
> When Tomcat loads fine, it appears that system property is not
> set and it is (successfully) falling back on the default:
>
> INFO: Initializing Coyote HTTP/1.1 on http-8580
> Jan 4, 2010 8:58:29 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 460 ms
> JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
> JAXP: loaded from fallback value:
> com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
These are actually two completely separate instances of searching for an XML parser. The first comes from javax.xml.parsers.DocumentBuilderFactory, the second from javax.xml.parsers.SAXParserFactory; each is controlled by a different system property and has a different default.
When I run Tomcat (with multiple webapps), I see several occurrences of the SAX one, followed by a few for DocumentBuilderFactory. You need to look at your logs in more detail for all of the JAXP print lines.
Since the error occurs after the "Starting Coyote" message, it's happening after Tomcat has finished its serial initialization of webapps, so the cause is most likely a timing issue with your webapp, setting the global system property which is impacting searches by other threads for the DocumentBuilderFactory. You could trap it with a SecurityManager setting that prevents writing of that system property.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org