List of usage examples for javax.ejb EJBException printStackTrace
public void printStackTrace()
From source file:edu.harvard.iq.dvn.core.index.IndexServiceBean.java
public void deleteIndexList(List<Long> studyIds) { Indexer indexer = Indexer.getInstance(); /*/*from www . j a v a 2 s .c o m*/ try { indexer.setup(); } catch (IOException ex) { ex.printStackTrace(); } */ for (Iterator it = studyIds.iterator(); it.hasNext();) { Long elem = (Long) it.next(); try { deleteDocument(elem.longValue()); } catch (EJBException e) { if (e.getCause() instanceof IllegalArgumentException) { System.out.println("Study id " + elem.longValue() + " not found"); e.printStackTrace(); } else { throw e; } } } }
From source file:edu.harvard.iq.dvn.core.index.IndexServiceBean.java
public void updateIndexList(List<Long> studyIds) { long ioProblemCount = 0; boolean ioProblem = false; Indexer indexer = Indexer.getInstance(); boolean deleteSuccess = true; /*//from w ww. j ava 2 s . c o m try { indexer.setup(); } catch (IOException ex) { ex.printStackTrace(); } */ for (Iterator it = studyIds.iterator(); it.hasNext();) { Long elem = (Long) it.next(); try { deleteSuccess = true; try { indexer.deleteDocumentCarefully(elem.longValue()); } catch (IOException ioe) { deleteSuccess = false; } if (deleteSuccess) { try { addDocument(elem.longValue()); } catch (IOException ex) { ioProblem = true; ioProblemCount++; Logger.getLogger(IndexServiceBean.class.getName()).log(Level.SEVERE, null, ex); } } } catch (EJBException e) { if (e.getCause() instanceof IllegalArgumentException) { System.out.println("Study id " + elem.longValue() + " not found"); e.printStackTrace(); } else { throw e; } } } handleIOProblems(ioProblem, ioProblemCount); }