log.error("Error during parsing, Caused by: {}.", e);
throw new PersistenceLoaderException("Error during parsing persistence.xml, caused by: ", e);
}
catch (IOException e)
{
throw new InvalidConfigurationException("Error reading persistence.xml, caused by: ", e);
}
catch (SAXException e)
{
throw new InvalidConfigurationException("Error parsing persistence.xml, caused by: ", e);
}
if (!parsingErrors.isEmpty())
{
throw new InvalidConfigurationException("Invalid persistence.xml", (Throwable) parsingErrors.get(0));
}
return persistenceXmlDoc;
}