ErrorDocument errorDoc = (ErrorDocument) identified; System.err.println("ERROR: " + identified.getId()); System.err.println(" message: " + errorDoc.getMessage()); if (errorDoc.getStackTraceStrings().isEmpty()) { System.err.println(" errorMessage: " + errorDoc.getExceptionMessage()); } else { System.err.println(" stacktrace:"); System.err.println(errorDoc.getExceptionMessage()); for (StackTraceElementBean stackTrace : errorDoc .getStackTraceStrings()) { System.err.println(" at " + stackTrace.getClassName() + "." + stackTrace.getMethodName() + "(" if (!errorDoc.getErrorReferences().isEmpty()) { System.err.print("Caused by "); for (T2Reference errorRef : errorDoc.getErrorReferences()) { printAllErrors(context.getReferenceService() .resolveIdentifier(errorRef, null, context));
public synchronized void store(ErrorDocument theDoc) throws DaoException { store.put(theDoc.getId(), theDoc); }
public static void buildErrorDocumentTree(DefaultMutableTreeNode node, ErrorDocument errorDocument, InvocationContext context) { DefaultMutableTreeNode child = new DefaultMutableTreeNode(errorDocument); String exceptionMessage = errorDocument.getExceptionMessage(); if (exceptionMessage != null && !exceptionMessage.equals("")) { DefaultMutableTreeNode exceptionMessageNode = new DefaultMutableTreeNode(exceptionMessage); child.add(exceptionMessageNode); List<StackTraceElementBean> stackTrace = errorDocument.getStackTraceStrings(); if (stackTrace.size() > 0) { for (StackTraceElementBean stackTraceElement : stackTrace) { Set<T2Reference> errorReferences = errorDocument.getErrorReferences(); for (T2Reference reference : errorReferences) { if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
String exceptionMessage = errorDoc.getExceptionMessage(); for (HandleException he : exceptionHandling .getHandleExceptions()) matchingDoc = errorDoc; if (!errorDoc.getErrorReferences().isEmpty()) for (T2Reference subRef : errorDoc.getErrorReferences()) for (T2Reference newErrorRef : getErrors(subRef)) { ErrorDocument subDoc = errorService String exceptionMessage = matchingDoc.getExceptionMessage(); exceptionMessage, newException, depth, context).getId(); exceptions.add(errorService.registerError(exceptionMessage, newException, 0, context).getId()); return replacement; matchingDoc.getStackTraceStrings().clear(); T2Reference replacement = errorService.registerError( exceptionReplacement.getReplacementMessage(), newException, depth, context).getId(); exceptions.add(errorService.registerError( exceptionReplacement.getReplacementMessage(), newException, 0, context).getId()); return replacement;
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component renderer = null; if (value instanceof DefaultMutableTreeNode) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; Object userObject = treeNode.getUserObject(); if (userObject instanceof ErrorDocument) { renderer = super.getTreeCellRendererComponent(tree, "<html><pre>" + StringEscapeUtils.escapeHtml(((ErrorDocument) userObject).getMessage()) + "</pre></html>", selected, expanded, leaf, row, hasFocus); } } if (renderer == null) { renderer = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); } if (renderer instanceof JLabel) { JLabel label = (JLabel) renderer; label.setIcon(null); } return renderer; } });
element.setAttribute("id", reference.toString()); org.jdom.Element messageElement = new org.jdom.Element("message"); messageElement.addContent(error.getExceptionMessage()); element.addContent(messageElement); } else if (reference.getReferenceType().equals(
public static void buildErrorDocumentTree(DefaultMutableTreeNode node, ErrorDocument errorDocument, ReferenceService referenceService) { DefaultMutableTreeNode child = new DefaultMutableTreeNode(errorDocument); String exceptionMessage = errorDocument.getExceptionMessage(); if (exceptionMessage != null && !exceptionMessage.equals("")) { DefaultMutableTreeNode exceptionMessageNode = new DefaultMutableTreeNode( child.add(exceptionMessageNode); List<StackTraceElementBean> stackTrace = errorDocument .getStackTraceStrings(); if (stackTrace.size() > 0) { for (StackTraceElementBean stackTraceElement : stackTrace) { Set<T2Reference> errorReferences = errorDocument.getErrorReferences(); for (T2Reference reference : errorReferences) { if (reference.getReferenceType().equals(
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component renderer = null; if (value instanceof DefaultMutableTreeNode) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; Object userObject = treeNode.getUserObject(); if (userObject instanceof ErrorDocument) { ErrorDocument errorDocument = (ErrorDocument) userObject; renderer = super.getTreeCellRendererComponent(tree, errorDocument.getMessage(), selected, expanded, leaf, row, hasFocus); } } if (renderer == null) { renderer = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); } if (renderer instanceof JLabel) { JLabel label = (JLabel) renderer; label.setIcon(null); } return renderer; }
public static void buildErrorDocumentTree(DefaultMutableTreeNode node, ErrorDocument errorDocument, ReferenceService referenceService) { DefaultMutableTreeNode child = new DefaultMutableTreeNode(errorDocument); String exceptionMessage = errorDocument.getExceptionMessage(); if (exceptionMessage != null && !exceptionMessage.equals("")) { DefaultMutableTreeNode exceptionMessageNode = new DefaultMutableTreeNode( child.add(exceptionMessageNode); List<StackTraceElementBean> stackTrace = errorDocument .getStackTraceStrings(); if (stackTrace.size() > 0) { for (StackTraceElementBean stackTraceElement : stackTrace) { Set<T2Reference> errorReferences = errorDocument.getErrorReferences(); for (T2Reference reference : errorReferences) { if (reference.getReferenceType().equals(
String message = errDocument.getMessage(); if (message != null && !message.isEmpty()) { errDocumentString = message + "\n"; String exceptionMessage = errDocument.getExceptionMessage(); if (exceptionMessage != null && !exceptionMessage.equals("")) { errDocumentString += exceptionMessage + "\n"; List<StackTraceElementBean> stackTrace = errDocument .getStackTraceStrings(); if (stackTrace.size() > 0) { for (StackTraceElementBean stackTraceElement : stackTrace) { Set<T2Reference> errorReferences = errDocument.getErrorReferences(); if (!errorReferences.isEmpty()) { errDocumentString += "Set of ErrorDocuments to follow." + "\n";
public synchronized boolean delete(ErrorDocument theDoc) throws DaoException { return store.remove(theDoc.getId())!=null; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component renderer = null; if (value instanceof DefaultMutableTreeNode) { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; Object userObject = treeNode.getUserObject(); if (userObject instanceof ErrorDocument) { renderer = super.getTreeCellRendererComponent(tree, "<html><pre>" + StringEscapeUtils.escapeHtml(((ErrorDocument) userObject).getMessage()) + "</pre></html>", selected, expanded, leaf, row, hasFocus); } } if (renderer == null) { renderer = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); } if (renderer instanceof JLabel) { JLabel label = (JLabel) renderer; label.setIcon(null); } return renderer; }
String exceptionMessage = errDocument.getExceptionMessage(); if (exceptionMessage != null && !exceptionMessage.equals("")) { DefaultMutableTreeNode exceptionMessageNode = new DefaultMutableTreeNode(exceptionMessage); errDocumentString += exceptionMessageNode + "\n"; List<StackTraceElementBean> stackTrace = errDocument.getStackTraceStrings(); if (stackTrace.size() > 0) { for (StackTraceElementBean stackTraceElement : stackTrace) { Set<T2Reference> errorReferences = errDocument.getErrorReferences(); if (!errorReferences.isEmpty()){ errDocumentString += "Set of ErrorDocumentS to follow." + "\n";
public synchronized void store(ErrorDocument theDoc) throws DaoException { store.put(theDoc.getId(), theDoc); }
if (identified instanceof ErrorDocument) { ErrorDocument errorDocument = (ErrorDocument) identified; return errorDocument.getMessage();
String exceptionMessage = errDocument.getExceptionMessage(); if (exceptionMessage != null && !exceptionMessage.equals("")) { DefaultMutableTreeNode exceptionMessageNode = new DefaultMutableTreeNode( errDocumentString += exceptionMessageNode + "\n"; List<StackTraceElementBean> stackTrace = errDocument .getStackTraceStrings(); if (stackTrace.size() > 0) { for (StackTraceElementBean stackTraceElement : stackTrace) { Set<T2Reference> errorReferences = errDocument.getErrorReferences(); if (!errorReferences.isEmpty()) { errDocumentString += "Set of ErrorDocumentS to follow." + "\n";
public synchronized void store(ErrorDocument theDoc) throws DaoException { store.put(theDoc.getId(), theDoc); }
if (identified instanceof ErrorDocument) { ErrorDocument errorDocument = (ErrorDocument) identified; return errorDocument.getMessage();
@PutIdentifiedOperation public void store(ErrorDocument theDocument) throws DaoException { if (theDocument.getId() == null) { throw new DaoException( "Supplied error document set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theDocument.getId().getReferenceType().equals( T2ReferenceType.ErrorDocument) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.ErrorDocument, something has probably " + "gone badly wrong somewhere earlier!"); } if (theDocument instanceof ErrorDocumentImpl) { try { sessionFactory.getCurrentSession().save(theDocument); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied ErrorDocument not an instance of ErrorDocumentImpl"); } } }
@DeleteIdentifiedOperation public boolean delete(ErrorDocument theDocument) throws DaoException { if (theDocument.getId() == null) { throw new DaoException( "Supplied error document set has a null ID, allocate " + "an ID before calling the store method in the dao."); } else if (theDocument.getId().getReferenceType().equals( T2ReferenceType.ErrorDocument) == false) { throw new DaoException("Strangely the list ID doesn't have type " + "T2ReferenceType.ErrorDocument, something has probably " + "gone badly wrong somewhere earlier!"); } if (theDocument instanceof ErrorDocumentImpl) { try { sessionFactory.getCurrentSession().delete(theDocument); } catch (Exception ex) { throw new DaoException(ex); } } else { throw new DaoException( "Supplied ErrorDocument not an instance of ErrorDocumentImpl"); } return true; }