Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 45421 invoked from network); 13 Jan 2004 20:23:31 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Jan 2004 20:23:31 -0000 Received: (qmail 4270 invoked by uid 500); 13 Jan 2004 20:23:16 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 4228 invoked by uid 500); 13 Jan 2004 20:23:16 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 4215 invoked by uid 500); 13 Jan 2004 20:23:16 -0000 Received: (qmail 4212 invoked from network); 13 Jan 2004 20:23:16 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 13 Jan 2004 20:23:16 -0000 Received: (qmail 45350 invoked by uid 1289); 13 Jan 2004 20:23:26 -0000 Date: 13 Jan 2004 20:23:26 -0000 Message-ID: <20040113202326.45349.qmail@minotaur.apache.org> From: rdonkin@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester package.html X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N rdonkin 2004/01/13 12:23:26 Modified: digester/src/java/org/apache/commons/digester package.html Log: Added debugging tips concerning SAX error handling. Revision Changes Path 1.25 +41 -1 jakarta-commons/digester/src/java/org/apache/commons/digester/package.html Index: package.html =================================================================== RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/package.html,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- package.html 6 Jan 2004 22:15:57 -0000 1.24 +++ package.html 13 Jan 2004 20:23:25 -0000 1.25 @@ -19,6 +19,7 @@ [Namespace Aware Parsing] [Pluggable Rules Processing] [Encapsulated Rule Sets] +[Troubleshooting] [FAQ] [Known Limitations] @@ -992,7 +993,46 @@ the same set of nested elements at different nesting levels within an XML document. - + +

Troubleshooting

+

Debugging Exceptions

+

+Digester is based on SAX. +Digestion throws two kinds of Exception: +

+
    +
  • java.io.IOException
  • +
  • org.xml.sax.SAXException
  • +
+

+The first is rarely thrown and indicates the kind of fundemental IO exception +that developers know all about. The second is thrown by SAX parsers when the processing +of the XML cannot be completed. So, to diagnose the cause a certain familiarity with +the way that SAX error handling works is very useful. +

+
Diagnosing SAX Exceptions
+

+This is a short, potted guide to SAX error handling strategies. It's not intended as a +proper guide to error handling in SAX. +

+

+When a SAX parser encounters a problem with the xml (well, ok - sometime after it +encounters a problem) it will throw a + +SAXParseException. This is a subclass of SAXException and contains +a bit of extra information about what exactly when wrong - and more importantly, +where it went wrong. If you catch an exception of this sort, you can be sure that +the problem is with the XML and not Digester or your rules. +It is usually a good idea to catch this exception and log the extra information +to help with diagnosing the reason for the failure. +

+

+General +SAXException's may wrap a causal exception. When exceptions are +throw by Digester each of these will be wrapped into a +SAXException and rethrown. So, catch these and examine the wrapped +exception to diagnose what went wrong. +

Frequently Asked Questions

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