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; }
- sepaRTLogger.error("SAXException error:",e);
- 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.