From 434747fbd551d3f540c7e5b3d7b86f4b984a1bf5 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 9 Jul 2013 16:44:01 +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. --- src/main/java/com/c2kernel/utils/CastorXMLUtility.java | 9 +++++++++ 1 file changed, 9 insertions(+) (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 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()); } -- cgit v1.2.3