magicbest / myschedule

Automatically exported from code.google.com/p/myschedule
0 stars 0 forks source link

myschedule did not start the schedule service on TOMCAT 7..0.20 when autoStart is set to true #71

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Drap myschedule-2.4.0.war file to the webapps directory of the tomcat
2. Drop the attached configuration file to the 
C:\Users\{user}\myschedule2\configs directory. It used postgres DB as 
JDBCStore. The tables have been created on the DB and it runs fine with Quartz 
examples as stand alone apps, such as example12 (with JDBCStore configured)
3. Start TOMCAT and the scheduler is listed as uninitialized on the web page
4. After clicking the initialize link, the initialized status is set to ture. 
But started is still false.
5. Also when trying to shutdown the tomcat, it produced the following errors:

INFO: Stopping service Catalina
Jan 26, 2012 7:59:47 PM org.apache.catalina.loader.WebappClassLoader 
clearReferencesJdbc
SEVERE: The web application [/myschedule] registered the JDBC driver 
[org.postgresql.Driver] but failed to unregister it when the web application 
was stopped. To prevent a memory leak, the JDBC Driver has been forcibly 
unregistered.

What is the expected output? What do you see instead?
I expect the app will auto initialize and start the scheduler.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by jinh...@gmail.com on 26 Jan 2012 at 12:11

Attachments:

GoogleCodeExporter commented 8 years ago
Hello jinhfan,

It's likely that you have error during startup of the scheduler. What the log 
output as it start up and print here any exception stack trace. Perhaps you 
didn't have the JDBC jars installed correctly? In which directory have you 
place these JDBC jars?

Original comment by saltnlight5 on 26 Jan 2012 at 2:07

GoogleCodeExporter commented 8 years ago
I find out where the problem was. It is due to extra space at the end of each 
property in the configure file, when specifying the autoInit, autoStart, wait 
for job to complete properties. 

After the extra spaces were removed from the configuration file, the app starts 
fine.

To avoid similar situation happening for others, I would sugest that we trim 
the property value before convert it to boolean.

Following is my suggested code change to myschedule.service.SchedulerService 
class.

autoInit = Boolean.parseBoolean(props.getProperty(AUTO_INIT_KEY, 
"true").trim());
        autoStart = Boolean.parseBoolean(props.getProperty(AUTO_START_KEY, "false").trim());        
preventAutoStartRemoteScheduler = 
Boolean.parseBoolean(props.getProperty(PREVENT_AUTO_START_REMOTE_SCHEDULER_KEY, 
"false").trim());
waitForJobsToComplete = 
Boolean.parseBoolean(props.getProperty(WAIT_FOR_JOBS_TO_COMPLETES_KEY, 
"false").trim());

Thank you for writing this application!

Original comment by jinh...@gmail.com on 28 Jan 2012 at 3:25

GoogleCodeExporter commented 8 years ago
I see. I will add this improvement in. Thank you for the finding jinhfan!

Original comment by saltnlight5 on 28 Jan 2012 at 4:13

GoogleCodeExporter commented 8 years ago
Fixed. See Release-2.4.1

Original comment by saltnlight5 on 28 Jan 2012 at 5:18