List of usage examples for javax.ejb EJBException initCause
public synchronized Throwable initCause(Throwable cause)
From source file:edu.harvard.iq.dvn.core.study.StudyServiceBean.java
private void copyXMLFile(Study study, File xmlFile, String xmlFileName) { try {/*ww w .ja v a2 s. c o m*/ // create, if needed, the directory File newDir = FileUtil.getStudyFileDir(study); if (!newDir.exists()) { newDir.mkdirs(); } FileUtil.copyFile(xmlFile, new File(newDir, xmlFileName)); } catch (IOException ex) { ex.printStackTrace(); String msg = "ImportStudy failed: "; if (ex.getMessage() != null) { msg += ex.getMessage(); } EJBException e = new EJBException(msg); e.initCause(ex); throw e; } }