File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending Mail from closing servlet

 
Dave Brown
Ranch Hand
Posts: 301
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic