Suggestions for how to avoid trinindad_scheduler_extension org.quartz.ObjectAlreadyExistsException

63 views
Skip to first unread message

Alex Holmes

unread,
Jan 18, 2013, 6:46:05 AM1/18/13
to rails-t...@googlegroups.com
I'm using the Deploying with JRuby book by Joe Kutner to configure a JRuby application with trinidad. While using his method for configuring scheduled jobs, that is to use a short script in config/initializers/jobs.rb to, "if $servlet_context", require each lib/jobs/*.rb file, where each contains a different class inheriting from the TrinidadSchedulerExtension.Cron class factory thing.

Everything works great when trinidad starts up in the development environment - the scheduled jobs run when they should and everything is dandy, until I hit the site for the first time in my browser when I believe it kicks off a web thread, which raises this exception:

org.jruby.exceptions.RaiseException: (JobError) org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'SendInvitesSchedule' and group: 'SendInvitesSchedule', because one already exists with this identification.

So it seems to be re-loading the rails project source code and reloading each job. I obviously don't want it duplicating each job so this is a good thing, but the traceback sadly lacks much of the functionality of the site it replaces :)

Any suggestions at all about what I might be doing wrong?

Many Thanks
Reply all
Reply to author
Forward
0 new messages