@@ -0,0 +1,1049 @@
+package org.opennms.netmgt.dao.support;%0A%0Aimport java.io.IOException;%0A%0Aimport org.exolab.castor.xml.MarshalException;%0Aimport org.exolab.castor.xml.ValidationException;%0Aimport org.opennms.netmgt.dao.CastorDataAccessFailureException;%0Aimport org.springframework.dao.DataAccessException;%0A%0A/**%0A * This is modelled after the Spring SQLExceptionTrnaslator.%0A * %0A * @author %3Ca href=%22mailto:dj@opennms.org%22%3EDJ Gregor%3C/a%3E%0A */%0Apublic class CastorExceptionTranslator %7B%0A    public DataAccessException translate(String task, IOException e) %7B%0A        return new CastorDataAccessFailureException(%22Failed to perform IO while %22 + task + %22: %22 + e, e);%0A    %7D%0A    %0A    public DataAccessException translate(String task, ValidationException e) %7B%0A        return new CastorDataAccessFailureException(%22Failed to validate XML file while %22 + task + %22: %22 + e, e);%0A    %7D%0A    %0A    public DataAccessException translate(String task, MarshalException e) %7B%0A        return new CastorDataAccessFailureException(%22Failed to marshal/unmarshal XML file while %22 + task + %22: %22 + e, e);%0A    %7D%0A%7D%0A

Add a translator for Castor exceptions (IOException, ValidationException, MarshalException) to Spring DataAccessException.