Codota Logo
MessagingException.getNextException
Code IndexAdd Codota to your IDE (free)

How to use
getNextException
method
in
javax.mail.MessagingException

Best Java code snippets using javax.mail.MessagingException.getNextException (Showing top 20 results out of 315)

  • Common ways to obtain MessagingException
private void myMethod () {
MessagingException m =
  • Codota IconException pex;Exception e;new MessagingException(pex.getMessage(), e)
  • Codota IconString s;new MessagingException(s)
  • Codota Iconnew MessagingException(addresses[i] + " is not an InternetAddress")
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

 ex = ( (MessagingException) ex ).getNextException();
} else {
 ex = null;
origin: com.sun.mail/javax.mail

  t = ((MessagingException) t).getNextException();
} else {
  t = cause;
origin: org.apache.james/james-server-mailets

private boolean hasNestedMessagingException() {
  return messagingException.getNextException() != null
    && messagingException.getNextException() instanceof MessagingException;
}
origin: google/mail-importer

public Exception getNextException() {
 return exception.getNextException();
}
origin: io.milton/aspirin

  private Exception resolveException(MessagingException msgExc) {
    MessagingException me = msgExc;
    Exception nextException = null;
    Exception lastException = msgExc;
    while ((nextException = me.getNextException()) != null) {
      lastException = nextException;
      if (MessagingException.class.getCanonicalName().equals(nextException.getClass().getCanonicalName())) {
        me = (MessagingException) nextException;
      } else {
        break;
      }
    }
    return lastException;
  }
}
origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

  public String getMessage() {
    Exception next = getNextException();
    if (next == null) {
      return super.getMessage();
    } else {
      return super.getMessage()
          + " ("
          + next.getClass().getName()
          + ": "
          + next.getMessage()
          + ")";
    }
  }
}
origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec

  public String getMessage() {
    Exception next = getNextException();
    if (next == null) {
      return super.getMessage();
    } else {
      return super.getMessage()
          + " ("
          + next.getClass().getName()
          + ": "
          + next.getMessage()
          + ")";
    }
  }
}
origin: org.apache.james/james-server-mailets

  public String getNestedExceptionMessage(MessagingException me) {
    if (me.getNextException() == null) {
      return sanitizeExceptionMessage(me);
    } else {
      Exception ex1 = me.getNextException();
      return sanitizeExceptionMessage(ex1);
    }
  }
}
origin: IanDarwin/javasrc

/** Send the file with no filename, assuming you've already called
 * the setBody() method.
 */
public void sendFile() {
  try {
    
    // Finally, send the message! (use static Transport method)
    Transport.send(mesg);
  } catch (MessagingException ex) {
    while ((ex = (MessagingException)ex.getNextException()) != null) {
      ex.printStackTrace();
    }
  }
}
origin: org.apache.james/james-server-mailets

private MessagingException handleMessagingException(Mail mail, MessagingException me) throws MessagingException {
  LOGGER.debug("Exception delivering message ({}) - {}", mail.getName(), me.getMessage());
  if ((me.getNextException() != null) && (me.getNextException() instanceof IOException)) {
    // If it's an IO exception with no nested exception, it's probably
    // some socket or weird I/O related problem.
    return me;
  } else {
    // This was not a connection or I/O error particular to one SMTP server of an MX set. Instead, it is almost
    // certainly a protocol level error. In this case we assume that this is an error we'd encounter with any of
    // the SMTP servers associated with this MX record, and we pass the exception to the code in the outer block
    // that determines its severity.
    throw me;
  }
}
origin: stackoverflow.com

 try {
  Properties props = new Properties();
  props.put("mail.from", "one four four@@or.newer");
  Session s = Session.getInstance(props);
  new MimeMessage(s).setFrom();
} catch (MessagingException me) {
  Throwable cause = me.getNextException();
  if (cause == null) {
    System.err.println("JavaMail 1.4.3 or older.");
  } else if (cause instanceof AddressException) {
    System.err.println("JavaMail 1.4.4 or newer.");
  } else {
    me.printStackTrace();
  }
}
origin: org.apache.james/james-server-mailets

private EnhancedMessagingException getNestedMessagingException() {
  Preconditions.checkState(hasNestedMessagingException());
  return new EnhancedMessagingException((MessagingException) messagingException.getNextException());
}
origin: org.apache.james/james-server-mailets

  private void logLevels(MessagingException me) {
    Exception ne;
    while ((ne = me.getNextException()) != null && ne instanceof MessagingException) {
      me = (MessagingException) ne;
      EnhancedMessagingException enhancedMessagingException = new EnhancedMessagingException(me);
      if (me.getClass().getName().endsWith(".SMTPAddressFailedException") || me.getClass().getName().endsWith(".SMTPAddressSucceededException")) {
        LOGGER.debug("ADDRESS :[{}] Address:[{}] Command : [{}] RetCode[{}] Response [{}]",
          enhancedMessagingException.computeAction(), me, enhancedMessagingException.computeAddress(),
          enhancedMessagingException.computeCommand(), enhancedMessagingException.getReturnCode());
      }
    }
  }
}
origin: org.apache.james/james-server-mailetcontainer-library

e.printStackTrace(out);
if (e instanceof MessagingException) {
  e = ((MessagingException)e).getNextException();
} else {
  e = null;
origin: org.apache.james/james-server-mailetcontainer-camel

e.printStackTrace(out);
if (e instanceof MessagingException) {
  e = ((MessagingException) e).getNextException();
} else {
  e = null;
origin: com.atlassian.core/atlassian-core

protected void handleException(Task task, Exception rootException) {
  TaskDecorator theTask = (TaskDecorator) task;
  if (theTask.getExecutionCount() > retryCount) {
    errorQueue.addTask(theTask.getTask());
  } else {
    failed.add(task);
  }
  if (rootException instanceof MessagingException) {
    Exception e = rootException;
    while (e instanceof MessagingException) {
      MessagingException me = (MessagingException) e;
      log.error(me.getMessage(), me);
      e = me.getNextException();
    }
  } else
    log.error("Failed to execute task", rootException);
}
origin: org.apache.james/james-server-mailets

if (((MessagingException) ex).getNextException() == null) {
  out.println(sanitizeExceptionMessage(ex));
} else {
  Exception ex1 = ((MessagingException) ex).getNextException();
  if (ex1 instanceof SendFailedException) {
    out.println("Remote mail server told me: " + sanitizeExceptionMessage(ex1));
origin: org.glassfish.metro/webservices-extra

  t = ((MessagingException) t).getNextException();
} else {
  t = cause;
origin: camunda/camunda-bpm-platform

logger.log(Level.FINE, "MessagingException while sending", mex);
if (mex.getNextException() instanceof IOException) {
origin: com.sun.mail/javax.mail

logger.log(Level.FINE, "MessagingException while sending", mex);
if (mex.getNextException() instanceof IOException) {
javax.mailMessagingExceptiongetNextException

Javadoc

Get the next exception chained to this one. If the next exception is a MessagingException, the chain may extend further.

Popular methods of MessagingException

  • getMessage
  • <init>
    Constructs a MessagingException with the specified Exception and detail message. The specified excep
  • printStackTrace
  • toString
    Override toString method to provide information on nested exceptions.
  • setNextException
    Add an exception to the end of the chain. If the end is not a MessagingException, this exception can
  • initCause
  • getCause
    Overrides the getCause method of Throwable to return the next exception in the chain of nested excep
  • superToString
    Return the "toString" information for this exception, without any information on nested exceptions.
  • getLocalizedMessage
  • addSuppressed
  • getStackTrace
  • setStackTrace
  • getStackTrace,
  • setStackTrace

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now