roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Mazza (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ROL-1758) Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x
Date Mon, 07 Jan 2013 22:28:12 GMT

    [ https://issues.apache.org/jira/browse/ROL-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13546342#comment-13546342
] 

Glen Mazza commented on ROL-1758:
---------------------------------

Do we still have this "taskrunner" in Roller 5?  I've never heard of it...
                
> Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x
> ---------------------------------------------------------
>
>                 Key: ROL-1758
>                 URL: https://issues.apache.org/jira/browse/ROL-1758
>             Project: Roller
>          Issue Type: Bug
>          Components: Database Access & Data Model
>            Reporter: David Johnson
>            Assignee: Glen Mazza
>            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
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.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message