roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Johnson (JIRA)" <j...@apache.org>
Subject [jira] Created: (ROL-1758) Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x
Date Mon, 03 Nov 2008 13:13:19 GMT
Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x
---------------------------------------------------------

                 Key: ROL-1758
                 URL: https://issues.apache.org/roller/browse/ROL-1758
             Project: Roller
          Issue Type: Bug
          Components: Database Access & Data Model
    Affects Versions: 4.0
            Reporter: David Johnson
            Assignee: David Johnson
            Priority: Minor
             Fix For: 4.0.1, 4.1


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
rollertask.sh 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 example.


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


Mime
View raw message