B
Blacksheep
Hi all,
I've been looking at this problem for a while, browsing all possible
resources for a possible explanation but no way.
My problem is the following :
I've got a JAVA application listening to messages falling on a
MQSeries queue. The message falling on the queue contains all required
information to compose a mail intended for some recipients. The
application is connected to a mail server and is supposed to send the
mail.
In our development environment everything is fine and works properly.
We are using Exchange server. I made several tests with some 3000
messages falling on the queue and we got 3000 mails in our mail boxes.
The program has been installed at a client site and there we run into
trouble.
After the fifth message has been sent, the program ends with an
exception. It looks like the SMTP server had closed the connection
with no apparent reason.
The log looks like this :
Wed Jun 23 14:59:49 CEST 2004 - spy3 - 5 tasks done.
Wed Jun 23 14:59:50 CEST 2004 - alerter - MailError - Mail server
error in execu
ting a process.
Error when sending a mail through Java Mail API.Can't send command to
SMTP host;
nested exception is:
java.net.SocketException: Software caused connection abort:
socket write error
null
com.misys.alerter.Spy$MailError: Error when sending a mail through
Java Mail API
..Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Software caused connection abort:
socket write
error
at com.misys.alerter.SpyMasterQ.doAction(SpyMasterQ.java:497)
at com.misys.alerter.Spy.run(Spy.java:112)
The line 497 is : try {mailer.sendMail(tmptitle, tmpbody,
recipientTo,recipientDummy, recipientDummy);
The class mailer fills in a mimeMessage and calls
transport.sendMessage(message, message.getAllRecipients() ) ;
which is where I loose control.
The connection to the mail server is made through this method :
public boolean connectSrv( String host, String user, String password)
throws NoSuchProviderException, MessagingException {
Properties props = new Properties();
props.put("mail.smtp.connectiontimeout", "0" );
props.put("mail.smtp.timeout", "0" );
props.put("mail.debug", "true");
session = Session.getDefaultInstance(props, null);
transport = session.getTransport("smtp");
transport.connect(host, user, password);
/* store date time when connection occurs */
dtconnected = new GregorianCalendar();
return transport.isConnected();
}
I added the debug property to get more information. It shows an SMTP
error 421.
Here are some bits of output :
DEBUG SMTP SENT: NOOP
DEBUG SMTP RCVD: 250 2.0.0 OK
DEBUG SMTP SENT: NOOP
DEBUG SMTP RCVD: 250 2.0.0 OK
DEBUG SMTP SENT: NOOP
DEBUG SMTP RCVD: 421 Too many errors on this connection---closing
DEBUG SMTP SENT: NOOP
I have the feeling that something goes wrong on the server side but
have no idea what.
Has any of you already experienced such problem ?
Thanks for your time reading this. Any help or suggestion will be
highly appreciated.
JC
I've been looking at this problem for a while, browsing all possible
resources for a possible explanation but no way.
My problem is the following :
I've got a JAVA application listening to messages falling on a
MQSeries queue. The message falling on the queue contains all required
information to compose a mail intended for some recipients. The
application is connected to a mail server and is supposed to send the
mail.
In our development environment everything is fine and works properly.
We are using Exchange server. I made several tests with some 3000
messages falling on the queue and we got 3000 mails in our mail boxes.
The program has been installed at a client site and there we run into
trouble.
After the fifth message has been sent, the program ends with an
exception. It looks like the SMTP server had closed the connection
with no apparent reason.
The log looks like this :
Wed Jun 23 14:59:49 CEST 2004 - spy3 - 5 tasks done.
Wed Jun 23 14:59:50 CEST 2004 - alerter - MailError - Mail server
error in execu
ting a process.
Error when sending a mail through Java Mail API.Can't send command to
SMTP host;
nested exception is:
java.net.SocketException: Software caused connection abort:
socket write error
null
com.misys.alerter.Spy$MailError: Error when sending a mail through
Java Mail API
..Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Software caused connection abort:
socket write
error
at com.misys.alerter.SpyMasterQ.doAction(SpyMasterQ.java:497)
at com.misys.alerter.Spy.run(Spy.java:112)
The line 497 is : try {mailer.sendMail(tmptitle, tmpbody,
recipientTo,recipientDummy, recipientDummy);
The class mailer fills in a mimeMessage and calls
transport.sendMessage(message, message.getAllRecipients() ) ;
which is where I loose control.
The connection to the mail server is made through this method :
public boolean connectSrv( String host, String user, String password)
throws NoSuchProviderException, MessagingException {
Properties props = new Properties();
props.put("mail.smtp.connectiontimeout", "0" );
props.put("mail.smtp.timeout", "0" );
props.put("mail.debug", "true");
session = Session.getDefaultInstance(props, null);
transport = session.getTransport("smtp");
transport.connect(host, user, password);
/* store date time when connection occurs */
dtconnected = new GregorianCalendar();
return transport.isConnected();
}
I added the debug property to get more information. It shows an SMTP
error 421.
Here are some bits of output :
DEBUG SMTP SENT: NOOP
DEBUG SMTP RCVD: 250 2.0.0 OK
DEBUG SMTP SENT: NOOP
DEBUG SMTP RCVD: 250 2.0.0 OK
DEBUG SMTP SENT: NOOP
DEBUG SMTP RCVD: 421 Too many errors on this connection---closing
DEBUG SMTP SENT: NOOP
I have the feeling that something goes wrong on the server side but
have no idea what.
Has any of you already experienced such problem ?
Thanks for your time reading this. Any help or suggestion will be
highly appreciated.
JC