Tabnine Logo
MessagingException.getCause
Code IndexAdd Tabnine to your IDE (free)

How to use
getCause
method
in
javax.mail.MessagingException

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

origin: google/mail-importer

@Override
public Throwable getCause() {
 return exception.getCause();
}
origin: spring-projects/spring-integration

if (e.getCause() instanceof NullPointerException) {
  failed.getAndIncrement();
origin: org.restlet.jee/org.restlet.ext.jaxrs

  /**
   * @see MessageBodyWriter#writeTo(Object, Class, Type, Annotation[],
   *      MediaType, MultivaluedMap, OutputStream)
   */
  public void writeTo(Multipart multipart, Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType,
      MultivaluedMap<String, Object> httpHeaders,
      OutputStream entityStream) throws IOException {
    try {
      multipart.writeTo(entityStream);
    } catch (MessagingException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      final IOException ioExc = new IOException(
          "Could not serialize the Multipart");
      ioExc.initCause(e);
      throw ioExc;
    }
  }
}
origin: org.restlet.jee/org.restlet.ext.jaxrs

/**
 * @see MessageBodyReader#readFrom(Class, Type, Annotation[], MediaType,
 *      MultivaluedMap, InputStream)
 */
public Multipart readFrom(Class<Multipart> type, Type genericType,
    Annotation[] annotations, MediaType mediaType,
    MultivaluedMap<String, String> httpResponseHeaders,
    InputStream entityStream) throws IOException {
  final String contentType = "multipart/form-data";
  final DataSource ds = new ByteArrayDataSource(entityStream, contentType);
  try {
    return new MimeMultipart(ds);
  } catch (MessagingException e) {
    if (e.getCause() instanceof IOException) {
      throw (IOException) e.getCause();
    }
    final IOException ioExc = new IOException(
        "Could not deserialize the data to a Multipart");
    ioExc.initCause(e);
    throw ioExc;
  }
}
origin: com.mulesoft.google/google-api-gdata

 /**
  * Generates output for requests that target media resources.
  */
 public void generate(OutputStream contentStream, OutputProperties request, 
    MediaMultipart source) throws IOException {

  OutputProperties prevProperties = null;
  try {
   prevProperties =
     GDataContentHandler.setThreadOutputProperties(request);
   source.writeTo(contentStream);
  } catch (MessagingException me) {
   
   // Unwrap basic I/O errors 
   Throwable t = me.getCause();
   if (t instanceof IOException) {
    throw (IOException) t;
   }
   
   // Wrap others based upon an invalid input entry
   IOException ioe = new IOException("Invalid multipart content");
   ioe.initCause(new InvalidEntryException("Invalid media entry", me));
   throw ioe;
  } finally {
   GDataContentHandler.setThreadOutputProperties(prevProperties);
  }
 }
}
origin: com.google.gdata/gdata-java-client

 /**
  * Generates output for requests that target media resources.
  */
 public void generate(OutputStream contentStream, OutputProperties request, 
    MediaMultipart source) throws IOException {

  OutputProperties prevProperties = null;
  try {
   prevProperties =
     GDataContentHandler.setThreadOutputProperties(request);
   source.writeTo(contentStream);
  } catch (MessagingException me) {
   
   // Unwrap basic I/O errors 
   Throwable t = me.getCause();
   if (t instanceof IOException) {
    throw (IOException) t;
   }
   
   // Wrap others based upon an invalid input entry
   IOException ioe = new IOException("Invalid multipart content");
   ioe.initCause(new InvalidEntryException("Invalid media entry", me));
   throw ioe;
  } finally {
   GDataContentHandler.setThreadOutputProperties(prevProperties);
  }
 }
}
origin: org.nuxeo.ecm.platform/nuxeo-platform-notification-core

} catch (MessagingException e) {
  String cause = "";
  if ((e instanceof SendFailedException) && (e.getCause() instanceof SendFailedException)) {
    cause = " - Cause: " + e.getCause().getMessage();
origin: org.apache.james/james-server-mailets

private ExecutionResult doDeliver(Mail mail, InternetAddress[] addr, Iterator<HostAddress> targetServers) throws MessagingException {
  MessagingException lastError = null;
  while (targetServers.hasNext()) {
    try {
      return mailDelivrerToHost.tryDeliveryToHost(mail, addr, targetServers.next());
    } catch (SendFailedException sfe) {
      lastError = handleSendFailExceptionOnMxIteration(mail, sfe);
    } catch (MessagingException me) {
      lastError = handleMessagingException(mail, me);
      if (configuration.isDebug()) {
        LOGGER.debug(me.getMessage(), me.getCause());
      } else {
        LOGGER.info(me.getMessage());
      }
    }
  }
  // If we encountered an exception while looping through,
  // throw the last MessagingException we caught. We only
  // do this if we were unable to send the message to any
  // server. If sending eventually succeeded, we exit
  // deliver() though the return at the end of the try
  // block.
  if (lastError != null) {
    throw lastError;
  }
  return ExecutionResult.temporaryFailure();
}
origin: com.lohika.alp/alp-reporter

  e.printStackTrace();                        
} catch (MessagingException e) {
  logger.warn(new MailerException("Unable to sent email to "+mailerConfigurator.getRecipients()+": "+e.getMessage()), e.getCause());
  e.printStackTrace();
} catch (IOException e) {
origin: com.atlassian.jira/jira-api

if (e.getCause() != null)
  cause = ", caused by: " + e.getCause().toString();
origin: EngineHub/CommandHelper

if(ex.getCause() instanceof SocketTimeoutException) {
  throw new CREIOException(ex.getCause().getMessage(), t, ex);
origin: com.helger/ph-smtp

if (WebExceptionHelper.isServerNotReachableConnection (ex.getCause ()))
 aExceptionToBeRemembered = new MailSendException ("Failed to connect to mail server: " +
                          ex.getCause ().getMessage ());
else
 aExceptionToBeRemembered = new MailSendException ("Mail server connection failed", ex);
javax.mailMessagingExceptiongetCause

Javadoc

Overrides the getCause method of Throwable to return the next exception in the chain of nested exceptions.

Popular methods of MessagingException

  • getMessage
  • <init>
    Constructs a MessagingException with the specified Exception and detail message. The specified excep
  • printStackTrace
  • getNextException
    Get the next exception chained to this one. If the next exception is a MessagingException, the chain
  • 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
  • superToString
    Return the "toString" information for this exception, without any information on nested exceptions.
  • getLocalizedMessage
  • addSuppressed
  • getStackTrace
  • setStackTrace
  • getStackTrace,
  • setStackTrace

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • ImageIO (javax.imageio)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now