Today we got a note from campus IT saying that they believed some
problems in their J2EE apps were related to "code that connects to
http://java.sun.com behind-the-scenes to download various DTD files
related to parsing XML documents."

In addition to whether it happens at all (going out to the internet to
retrieve the DTD) I'm also curious if it's the XML parser, or the
Servlet container, etc.  What component would make the call out to get
the DTD?

I've always wondered...

It's the XML parser that is used by the Servlet container which goes looking for the DTD so that it can perform a validating parse of the XML. In most cases, a validating parse is not strictly required (although prior to Struts 1.1, Struts depended on a validating parse of struts-config.xml to fill in certain default values, etc.)


With yesterday's outage of java.sun.com, we solved the hang-on-launch problem by disabling validation. For Jetty (which is the servlet container for our JBoss deployment), you can do this by defining a system property:

org.mortbay.xml.XmlParser.NotValidating=true

How you actually control this would be dependent on the servlet container and its own configuration.

If you are processing XML using SAX, you can also intervene in the entity resolution. Commons Digester does this, for instance, by implementing the org.xml.sax.EntityResolver interface.

http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/EntityResolver.html
http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/helpers/DefaultHandler.html
http://jakarta.apache.org/commons/digester/xref/org/apache/commons/digester/Digester.html#1661

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to