diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-07-09 16:44:01 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-07-09 16:44:01 +0200 |
| commit | 434747fbd551d3f540c7e5b3d7b86f4b984a1bf5 (patch) | |
| tree | 78f5b8dc6377043ac4303b275977a8215ece778c /src/main/java/com/c2kernel/utils | |
| parent | 76f527597567cecc932501b0ad5f68ee9119c636 (diff) | |
Better debugging:
ProxyLoader logs error at log(7)
CastorXMLUtility creates an Unmarshaller in the constructor to detect
mapfile problems then rather than on first use. Mapping objects don't do
it.
Diffstat (limited to 'src/main/java/com/c2kernel/utils')
| -rw-r--r-- | src/main/java/com/c2kernel/utils/CastorXMLUtility.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/c2kernel/utils/CastorXMLUtility.java b/src/main/java/com/c2kernel/utils/CastorXMLUtility.java index 4839fa3..6a9350f 100644 --- a/src/main/java/com/c2kernel/utils/CastorXMLUtility.java +++ b/src/main/java/com/c2kernel/utils/CastorXMLUtility.java @@ -57,6 +57,15 @@ public class CastorXMLUtility throw new InvalidDataException("Error loading map '"+thisMap+"'", "");
}
}
+
+ // Test the maps now, instead of on first use.
+
+ try {
+ new Unmarshaller( mMapping );
+ } catch (MappingException e) {
+ Logger.error(e);
+ throw new InvalidDataException("Castor mapfiles are not valid", "");
+ }
Logger.msg(1, "Loaded all maps from "+mapURL.toString());
}
|
