Dashboard > XWork > Documentation > Precise Error Reporting
  XWork Log In View a printable version of the current page.  
  Precise Error Reporting
Added by Rainer Hermanns, last edited by Rainer Hermanns on Dec 01, 2006
Labels: 
(None)

With the multiple levels of configuration, constant overrides, and bean selection, it can be confusing as to how the framework is configured and how it got there. To assist debugging and provide the ability to continue to provide more line-precise error reporting, the configuration loader remembers the location of not only XML elements, but also Java Properties file properties.

How it works is instead of storing configuration properties in a plain java.util.Properties object, we have a special LocatableProperties class in XWork. This class leverages the location classes in XWork to store location information for the whole properties file but also individual properties. We use this to gather configuration properties during configuration loading. This will allow us to display at any given point the location of each property setting. This capability should be very useful when trying to determine what XML or Properties file overwrote what and when.

Interestingly, in addition to remembering the URI and line number of Properties properties, the parser we "borrowed" from Commons Configuration even gathers preceding comments, which are also stored in the Location object.

There are some very interesting possibilities here to increase the transparency of the framework in error and debugging conditions.

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators