tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <>
Subject Re: Exception while sending Email
Date Fri, 10 Jan 2014 11:31:45 GMT
response inline/below.

On Fri, Jan 10, 2014 at 5:40 AM, Radhakrishna Kalyan <>wrote:

> Hi,
> <snip>

> I have a session bean and it is trying to send an email using Java's email
> using Transport.send().
> But I am getting the following exception:
> *javax.mail.MessagingException: Read timed
> out         at

SocketTimeoutException is 'usually' a valid exception that you 'may' want
to handle (or just log to error file) in your app, but keep reading below.


> org.apache.geronimo.javamail.transport.smtp.SMTPConnection.receiveLine(
> at
> org.apache.geronimo.javamail.transport.smtp.SMTPConnection.receiveLine(
> at
> org.apache.geronimo.javamail.transport.smtp.SMTPConnection.getReply(
>         at
> org.apache.geronimo.javamail.transport.smtp.SMTPConnection.sendCommand(
> at
> org.apache.geronimo.javamail.transport.smtp.SMTPConnection.sendQuit(
> at
> org.apache.geronimo.javamail.transport.smtp.SMTPConnection.close(
>         at
> org.apache.geronimo.javamail.transport.smtp.SMTPTransport.close(

As you can see above, org.apache.geronimo.javamail is a 'wrapper' for
(oracle/sun's) javamail (jar).

> at javax.mail.Transport.send(        at
> javax.mail.Transport.send(         at
> com.netgiro.utils.mail.NgMailSenderImpl.sendMessageUsingJavaMail(
> at
> com.netgiro.utils.mail.NgMailSenderImpl.sendMessageNow(*
> Any suggestions about how to send email in OpenEJB

When I first started using TomEE (OpenEJB) to send/receive emails, I ran
into an unrelated issue/defect, GERONIMO-6421[1]. After reporting that
issue to tomee user list, I was advised by David Blevins to do the

1. remove geronimo-javamail_1.4_mail-1.8.2.jar from tomee/lib folder
2. drop/replace-that-file-with oracle/sun's javamail JAR file

That solved my issue. So, whenever I use new release/snapshot of tomee+, i
always repeat the steps above, before I start tomee (and my app). If you
continue to experience the SocketTimeoutException, then there is an I.P.
connection issue between your app/server and target/email server. Since
tomee=tomcat, you can configure your <Connector> in tomee's server.xml to
avoid SocketTimeoutException's.

While searching my apache/tomee emails, I found the following tomee-user

Not loading smtps resource properly[2]

you may want to read that topic and search tomee/openejb user list for
related topics, if you prefer to use geronimo's wrapper jar.

Also, below is my question[3] on tomcat-user list about
SocketTimeoutException and someone's response,

> From: Howard W. Smith, Jr. []
> Subject: Read timed out

> The stack trace below is the exception that occurred today. Does this look
> like a tomcat or google calendar issue?

It has nothing to do with Tomcat; it's your webapp that opened the
connection to Google - Tomcat is completely unaware of it.  Whether it's a
Google limitation or a bug in your webapp can't be determined from just the
stack trace.  Best if you could get a network traffic capture for the
incident and see if the request to Google is malformed, which might well
result in the Google server ignoring it.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message