Codota Logo
MessagingException.getCause
Code IndexAdd Codota 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)

  • 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: 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

  • Finding current android device location
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • notifyDataSetChanged (ArrayAdapter)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
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