roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Johnson (JIRA)" <>
Subject [jira] Updated: (ROL-1758) Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x
Date Tue, 23 Dec 2008 20:00:19 GMT


David Johnson updated ROL-1758:

    Fix Version/s:     (was: 4.0.1)
                       (was: 4.1)

> Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x
> ---------------------------------------------------------
>                 Key: ROL-1758
>                 URL:
>             Project: Roller
>          Issue Type: Bug
>          Components: Database Access & Data Model
>            Reporter: David Johnson
>            Assignee: David Johnson
>            Priority: Minor
> Background
> The TaskRunner class is designed to make it as easy as possible to run a Roller task
from the command-line, for those who wish to use a cron job or other script-based task running
to run Roller tasks instead of running them inside the Java VM. The main benefit of using
TaskRunner is that it does not require you to list all of the Roller jars in the classpath,
instead you just specify the webapp dir and a secondary lib directory for JDBC jars etc. See for an example of how to run 
> The problem
> TaskRunner was working in Roller 3.x, but the scheduled task changes in Roller 4.0 broke
the TaskRunner because all Roller tasks now extend RollerTaskWithLeasing, which expects Roller
to be bootstrapped. If we have to bootstrap Roller first, in TaskRunner -- then TaskRunner
will need the full Roller classpath, which defeats its purpose.
> If we add the following code to RollerTaskWithLeasing we can ensure that Roller is bootstrapped
before the task is run.
>     public final void run() {
>         if (!WebloggerFactory.isBootstrapped()) {
>             try {
>                 WebloggerStartup.prepare();
>                 WebloggerFactory.bootstrap();
>             } catch (Throwable ex) {
>                 log.error("ERROR bootstrapping Roller", ex);
>                 throw new RuntimeException("ERROR bootstrapping Roller", ex);
>             }
>         }
> But that's not the only problem...
> I'm working on fixing this, and have just committed some related fixes in the rollertask

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message