Quantcast
Channel: Active questions tagged propagation - Stack Overflow
Viewing all articles
Browse latest Browse all 54

How to propagate SAXExcetion while validating xml using javax.xml.validation.Validator

$
0
0
  public boolean validateXML() throws Exception {        sepaRTLogger.info("Entered validateXML()");        Schema schema = listOfXSDs.get(xmlVersion);        sepaRTLogger.debug("matched schema:::" + schema);        System.out.println("matched schema:::" + schema);        try {            Validator validator = schema.newValidator();            validator.validate((Source) (new StreamSource(XMLStreamForValidation)));        } catch (Exception e){            if(e instanceof IOException) {                sepaRTLogger.error("IOException error:",e);            }            if(e instanceof SAXException){                sepaRTLogger.error("SAXException error:",e);                retriggerException.reThrow(msgTagID, null, new SAXException(), e.getMessage(), "TFLT101");            }            throw new Exception( e);        }finally{            XMLStreamForValidation.close();        }        return true;    }
  1. sepaRTLogger.error("SAXException error:",e);
  2. retriggerException.reThrow(msgTagID, null, new SAXException(), e.getMessage(), "TFLT101");

Line 1 is printing error but excetion become null in line 2. So not able to propagate this excetion.


Viewing all articles
Browse latest Browse all 54

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>