cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andr...@apache.org>
Subject Re: NPE in AbstractCachingProcessingPipeline when called from a Cron job
Date Tue, 23 Dec 2008 22:18:57 GMT
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


Mime
View raw message