You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andreas Hartmann <an...@apache.org> on 2008/12/23 23:18:57 UTC

Re: NPE in AbstractCachingProcessingPipeline when called from a Cron job

Andreas Hartmann schrieb:
> When calling a pipeline from a ServiceableCronJob, I'm getting the 
> following exception:

[…]

> Just a random thought: Since the BackgroundEnvironment initializes the 
> CommandLineRequest, would it make sense to set the value for the 
> CLI_REQUEST_ID in the object model too?

Here's the patch that solves the issue for me:


Index: 
src/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java
===================================================================
--- 
src/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java 
(revision 729139)
+++ 
src/java/org/apache/cocoon/environment/background/BackgroundEnvironment.java 
(working copy)
@@ -22,6 +22,7 @@
  import org.apache.cocoon.environment.Context;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
+import 
org.apache.cocoon.environment.commandline.AbstractCommandLineEnvironment;
  import org.apache.cocoon.environment.commandline.CommandLineContext;
  import org.apache.cocoon.environment.commandline.CommandLineRequest;
  import org.apache.cocoon.environment.commandline.CommandLineResponse;
@@ -65,6 +66,7 @@
          this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT,
                               new CommandLineResponse());
          this.objectModel.put(ObjectModelHelper.CONTEXT_OBJECT, ctx);
+ 
this.objectModel.put(AbstractCommandLineEnvironment.CLI_REQUEST_ID, "");
      }

      /**
@@ -89,6 +91,7 @@
                               new CommandLineResponse());
          this.objectModel.put(ObjectModelHelper.CONTEXT_OBJECT,
                               new 
CommandLineContext(context.getAbsolutePath()));
+ 
this.objectModel.put(AbstractCommandLineEnvironment.CLI_REQUEST_ID, new 
String(uri));
      }

      /**


-- Andreas