aspose file tools*
The moose likes Servlets and the fly likes Sending Mail from closing servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending Mail from closing servlet" Watch "Sending Mail from closing servlet" New topic
Author

Sending Mail from closing servlet

Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
Hi All,

I've ran into a bit of a problem, I have a servlet loaded via context listener.

If the context is destroyed for any reason, I want to send an email to myself warning me that its no longer running..

However, during testing when I stop the application, the mail cannot be sent..

I'm using javax.mail to send which I thought would run totally independant of my webapp but when its trying to send its outputting a load of errors to my log.. e.g.

INFO: Illegal access: this web application instance has been stopped already. Could not load META-INF/javamail.providers

Anyone any insight on why this would be happening ?

Thanks


Regards, Dave Brown
SCJP 6 - [url]http://www.dbws.net/[/url] - Check out Grails Forum
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61762
    
  67

Originally posted by Dave Brown:
I have a servlet loaded via context listener.


I don't know what this means. Please explain.

If the context is destroyed for any reason, ...However, during testing when I stop the application, the mail cannot be sent..


How are you detecting this situation?

I'm using javax.mail to send which I thought would run totally independant of my webapp but when its trying to send its outputting a load of errors to my log.. e.g.


If you are running the code in a servlet or listener, how could it be independent?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending Mail from closing servlet