You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "David Johnson (JIRA)" <ji...@apache.org> on 2008/11/03 14:13:19 UTC

[jira] Created: (ROL-1758) Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x

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.


[jira] Updated: (ROL-1758) Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x

Posted by "David Johnson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/roller/browse/ROL-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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: https://issues.apache.org/roller/browse/ROL-1758
>             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 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.


[jira] Updated: (ROL-1758) Cannot run Roller 4.0 tasks via TaskRunner, worked in 3.x

Posted by "David Johnson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/roller/browse/ROL-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Johnson updated ROL-1758:
-------------------------------

    Affects Version/s:     (was: 4.0)

> 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
>            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.