Posted by: Chyne on: July 4, 2009
Most of the users do not concern about the order of the startup services. The most important is all the relevant (e.g. database, Tomcat) has been installed successfully in order for the system able to run in a proper manner. If you are lucky, you had set the database service (e.g. MySQL) that able to startup automatically when you startup your pc. However, some users do not configure the database service to be started automatically and might startup the application service before the database service.
The order of the startup services are very important if you had services that depend on each other. If you startup a database service before an application service, you will encounter this error:-
There was a SQL exception checking for database driver correctness. Skipping.
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory
(Network error IOException: Connection refused: connect)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
In order to set the dependency rules to correct the startup order, there are two methods you can give it a try:
1) Via the command prompt:
C:\Documents and Settings\Testing>sc config [application service] depend= [database service]
2) Edit the system registry
This method has been documented in details at http://support.microsoft.com/kb/193888.