I don't think it's possible to stop Tomcat when a problem occurs : in fact, you could stop the starting of your webapp, but happily Tomcat was not designed to crash when a webapp it's running can't start,obviously because that could impact some others apps already (well) running.
About the mail being sent, that's not complicated though. Hibernate uses commons-logging, which lets you use log4j for example as the actual logging system. So, just configure log4j to use an email appender, then choose the level from which you want emails to be sent : e.g. maybe you do not want to send messages less important than warn level, and you're done :-).
_________________ Baptiste
PS : please don't forget to give credits below if you found this answer useful :)
|