• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Intermittent "javax.mail.SendFailedException: Sending failed" error

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using an application that is supposed to send up to 6 notifications. This is not happening consistently - sometimes I get all 6, sometimes the 4,5 or 6 is missing - in any combination. Note if #4 fails to deliver, this does not mean that #5 and/or 6 do not come through.

The error in the Oracle application server log shows the following message



11:21:10 WARN AJPRequestHandler-ApplicationServerThread-11 [ NotificationManager.sendEmail ] Sending the email to the following server failed : null:25
org.apache.commons.mail.EmailException: Sending the email to the following server failed : null:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873)
at org.apache.commons.mail.Email.send(Email.java:898)
at com.intaz.safetsmart.notification.NotificationManager.sendEmail(NotificationManager.java:204)
at com.intaz.safetsmart.notification.NotificationManager.sendNotification(NotificationManager.java:130)
at com.intaz.safetsmart.workflow.action.notify.RoleIfIncidentClassification.execute(RoleIfIncidentClassification.java:110)
at com.intaz.safetsmart.workflow.Workflow.executeActionHandler(Workflow.java:531)
at com.intaz.safetsmart.workflow.Workflow.executeActionHandler(Workflow.java:438)
at com.intaz.safetsmart.workflow.WorkflowDefinition.processInitialEvent(WorkflowDefinition.java:308)
at com.intaz.safetsmart.workflow.WorkflowDefinition.processInitialEvent(WorkflowDefinition.java:161)
at com.intaz.safetsmart.workflow.WorkflowEngine.checkForNewWorkflows(WorkflowEngine.java:180)
at com.intaz.safetsmart.workflow.WorkflowEngine.processEvent(WorkflowEngine.java:92)
at com.intaz.safetsmart.presentation.generic.WizardObject.save(WizardObject.java:560)
at com.intaz.safetsmart.presentation.handler.GenericHandler.handleRequest(GenericHandler.java:469)
at com.intaz.safetsmart.presentation.ControllerServlet.performTask(ControllerServlet.java:119)
at com.intaz.safetsmart.presentation.BaseServlet.doPost(BaseServlet.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.SendFailedException:
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)


on a different occassion, the error was

Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: mail.test.xxx.xxx.xxx.au, port: 25
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)
 
Marshal
Posts: 22445
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first exception is difficult to interpret, as the exception message is null. Can you call setDebug(true) on your email prior to sending it? That will turn on session debugging, which will help find the cause.
The second exception is clear. You can't connect to any SMTP server on port 25 on that server. Either there is no SMTP server there, or you're being blocked, or the server simply is too busy to accept any connections.
 
Sheriff
Posts: 26768
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As for the last one: you are going to have to be prepared for the possibility that the SMTP server you are using to send e-mail may not be running. You can't expect 100% reliability from any component. So you have to make a design decision about what to do when that happens. So far your decision has been that you will discard the e-mail, but apparently you aren't satisfied with that. So you're going to have to make a different decision.
 
Jaine Steer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you call setDebug(true) on your email prior to sending it? That will turn on session debugging, which will help find the cause.

I am not sure how to do this. This is an application that is provided by the vendor. I do have access to the Oracle Application server, but would not know where this type of command would go.

Also, for the second listed exception, this SMTP server has not changed. In this case, it was for a virtual system, but I have the same intermittent behaviour occurring in both physical and virtual systems. In the case of the physical system, this also hosts production for the entire 2600 strong org, so I am reasonably confident that it is not that it is up and running. I do not expect that it is that I am blocked, as all emails in the test environment are set to my own address, and it would not make sense that I do not receive (say) #5, and yet #6 comes through. How do I find out if the server is too busy? I have been shown the Microsoft Exchange server output from one of these failed email attempts, and the information in the Message subject column of the Message Tracking Results outpup is showing "wrong email".

This may be off track, but is there a way of trying to identify what went into the Exchange server?
 
Paul Clapham
Sheriff
Posts: 26768
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like there should be somebody in charge of administering the Exchange server. If you have questions about Exchange then that would definitely be the person to talk to.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic