Example usage for javax.ejb EJBException printStackTrace

List of usage examples for javax.ejb EJBException printStackTrace

Introduction

In this page you can find the example usage for javax.ejb EJBException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

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);

}