I have scenario ,
If Below exception occurs in tomcat " java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] System resource exceeded."
Then Restart The Server .
Is there any possible solution .
Thanks
I have scenario ,
If Below exception occurs in tomcat " java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] System resource exceeded."
Then Restart The Server .
Is there any possible solution .
Thanks
You've mentioned Bash, so one possibility is have a cron job which calls a shell script that reads the log every amount of x, searching for that exception, and if found restart Tomcat like this:
#!/bin/sh
results=`grep " java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] System resource exceeded." /path/to/tomcat.log
if [ ! -z "$results" ]
then
service tomcat restart
fi
Issues with this are if Tomcat doesn't restart correctly how would you know. You would need to extend this to let you know that Tomcat has been restarted and/or check the service has restarted normally. You would also need some form of date checking or log renaming or everytime that log is read it could act upon previous cases of that Exception being logged.
But with Jan's comment on your question would probably be best to address the underlying issue of why are the system resources being exceeded (e.g. connection pooling, threads etc).