These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to exit when problem with hibernate config files
PostPosted: Fri Dec 08, 2006 4:22 pm 
Newbie

Joined: Sat Dec 02, 2006 1:09 am
Posts: 12
For development I would like to set Hibernate/Tomcat up so that if an error occurs while starting up the following happens:

1. An error is written to a log file that I specify
2. Tomcat exits (does not continue)
3. An email is sent to a list or group specified

I would like to set this up if there is an error with *ANY* Hibernate related config file. These errors are usually indicated in the tomcat or app server log. I want to immediately exit the app server and send notification.

thanks


R


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 08, 2006 4:45 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
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 :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.