From 6bdf2e7011d3c7c4edf13bccebc8c89fc1e671d3 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 28 Aug 2013 11:43:15 +0200 Subject: 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. Conflicts: src/main/java/com/c2kernel/utils/CastorXMLUtility.java --- src/main/java/com/c2kernel/utils/CastorXMLUtility.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/c2kernel/utils') diff --git a/src/main/java/com/c2kernel/utils/CastorXMLUtility.java b/src/main/java/com/c2kernel/utils/CastorXMLUtility.java index 2a8c3a0..3bbb77f 100644 --- a/src/main/java/com/c2kernel/utils/CastorXMLUtility.java +++ b/src/main/java/com/c2kernel/utils/CastorXMLUtility.java @@ -57,7 +57,16 @@ public class CastorXMLUtility throw new InvalidDataException("Error loading map '"+thisMap+"'", ""); } } - Logger.msg("Loaded all maps from "+mapURL.toString()); + + // 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()); } -- cgit v1.2.3