- This topic has 2 replies, 2 voices, and was last updated 19 years ago by momyyao.
-
AuthorPosts
-
momyyaoMemberI have a web project (struts + hibernate) running on my company’s new web server(Tomcat + MySql). It was fine when I first started tomcat. But the next day, when I came back to work, the home page gives me a 500 error. In the log file, it says “Could not execute query”. I restared MySQL and Tomcat. The project was back online again. However, the problem happens everyday. And, I have to do a restart every morning.
The project was created with MyEclipse and deployed into webapp as a war file. And both MySQL and Tomcat seem to be working before I restarted them.
Can anyone here tell me how to solve this problem?
Thanks in advance!
Riyad KallaMemberI am willing to bet anything that you are leaking your DB connections, either knowingly or unknowingly.
Try this, restart Tomcat and MySQL, then go to your site and browse around to pages that cause DB access, keep doing it, try using Refresh a lot, see if you can get it to crash. Then check your log file and see what is going on. Also check your Catalina.out file (Linux) for system messages.
I encountered a ghost problem like this a while back, and it actually turned out to be that a certain sub-version of Java, when updated, stopped allowing 0000-00-00 as a valid JDBC date, so all my code that processed dates were throwing exceptions (quietly) and leaking the DB connections on the site, the exact same thing happened, had to restart it twice a day, and woudl get error 500s.
momyyaoMemberThanks!
Actually I tried to restart only Tomcat this morning, and it worked. I also looked into the log files in Tomcat. But there isn’t any error msg other than the Hibernate Exception.
The web site has a side bar that needs to retrieve info. from DB. So when it fails to connect to DB, it throws 500 error.
Anyone, any idea? -
AuthorPosts