> From: David Haraburda [mailto:david.harabu...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to