[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2194) Terrible error message for DTD not found when reading *.xml config file

Stuart Robertson (JIRA) jira-events at lists.jboss.org
Wed Oct 31 10:38:44 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-2194?page=comments#action_12385298 ] 
            
Stuart Robertson commented on JBSEAM-2194:
------------------------------------------

I've been bitten by this sporadically as well.  and if you google for 'seam "DocumentException: jboss.com"' others are too.  I think it comes up with those who are working with Seam on a single project long enough to go through upgrades of Seam where the DTD/Schemas change.  Obviously it's just a problem of updating the DTD/Schema references in all xml files Seam loads.

And if you look at the code, Seam does in fact pass along the exceptions it receives.  Where it fails though is to add any context to the exception which might help the developer understand what's happening.  Seam explains that dom4j is unable to find jboss.com over the network.   It would be far better though if in addition to that, it explained which xml file it was parsing when it hit that problem.  Pages.getDocumentRoot(Pages.java:950) rethrows the DocumentException as a runtime.  But getDocumentRoot() doesn't have enough information to create a meaningful message since it accepts an InputStream, and so doesn't know the larger context.

If instead of RuntimeException bubbling all the way up, Pages.parse() caught the exception, added the relevant context (at the very least which file caused the problem, and it'd be a great place to explain a likely cause of this is stale DTD/Schema refs), that'd prevent a lot of frustration on the part of Seam users who encounter this.

Facelets is fantastic because of the error messages it gives.  It'd be nice if Seam helped us a long for this problem too. 


> Terrible error message for DTD not found when reading *.xml config file
> -----------------------------------------------------------------------
>
>                 Key: JBSEAM-2194
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2194
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0.CR3
>         Environment: Eclipse 3.3
> JBoss 4.2.2
>            Reporter: Scott Bader
>            Priority: Minor
>
> Problem experienced when application was reading login.page.xml file, but it could potentially happen
> anywhere when reading an XML file where DTD is not found.
> Seeing debug page with:
> Exception during request processing: 
> Caused by java.lang.RuntimeException with message: "org.dom4j.DocumentException: jboss.com Nested exception: jboss.com" 
> Stacktrace snippet:
> org.dom4j.DocumentException: jboss.com Nested exception: jboss.com
> 	at org.dom4j.io.SAXReader.read(SAXReader.java:484)
> 	at org.dom4j.io.SAXReader.read(SAXReader.java:343)
> 	at org.jboss.seam.util.XML.getRootElement(XML.java:21)
> 	at org.jboss.seam.navigation.Pages.getDocumentRoot(Pages.java:950)
> ...
> Nested exception: 
> java.net.UnknownHostException: jboss.com
> 	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
> 	at java.net.Socket.connect(Socket.java:519)
> Recommend added error handling in org.jboss.seam.util.XML.getRootElement 
> method or better yet org.jboss.seam.navigation.Pages.getDocumentRoot method
> and log the problem there.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list