I see you got a number of good suggestions.  If you still have this problem you 
could try doing a netstat command to see if your server is holding the 
connections to the SMTP server.  I have seen this type of thing cause some 
weird problems.

If your server is holding several connections to the SMTP server it would mean 
that the application isn't closing the socket when it is done.

-----Original Message-----
From: Raymond Holguin [mailto:[EMAIL PROTECTED]
Sent: Friday, May 04, 2007 12:38 PM
To: users@tomcat.apache.org
Subject: Tomcat randomly cannot connect to SMTP host


Hello,
    I have tomcat 5.0.28 running on my Linux machine, and all my 
applications running under this tomcat experience the same problem at 
the same time which is why I believe it to be a tomcat issue.
When my applications attempt to send out an email I get this error message

(Mail server connection failed; nested exception is 
javax.mail.MessagingException: Could not connect to SMTP host: xxxxxx, 
port: 25; nested exception is: java.net.ConnectException: Connection 
refused)

The SMTP server is fine, because I can use it from other applications 
not on that tomcat server.  I can also telnet into the SMTP server just 
fine from that same machine, so i don't believe its a server/port 
blocking issue on the OS or hardware level.  The only way I am able to 
resolve the problem is to restart Tomcat.  Once Tomcat is restarted, 
then all operation with emailing works fine again.  I cannot seem to 
force the issue to happen so i don't know how reproduce it on demand, 
even though I know that would help in solving the issue.  This problem 
just seems to come up randomly and wont go away until I restart tomcat.
If anyone can please help me solve this issue that would be greatly 
appreciated.  I have important applications running on this machine and 
its a great inconvenience to those using the applications when this 
problem comes up.
Thank you
-Ray

-- 
------------------------------------------------------------------------
Raymond Holguin
Programmer Analyst
College of Humanities, Arts, and Social Sciences
Tel: (951) 827-6212
Email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to