Login  Register

Re: Re: PDF generation from scheduled task fails

Posted by Jasper Linthorst on May 03, 2011; 11:09am
URL: https://discuss.orbeon.com/PDF-generation-from-scheduled-task-fails-tp3489990p3492211.html

Ok, eventually I fixed things in a different matter, because it turned out that the xforms submission processor (which I tried to use to make the http request) also uses the ExternalContext (so I ended up with a similar error). What I've done now is I've created a custom 'xhtml-to-pdf' processor based on Orbeon's code and made a minor change so that it doesn't retrieve the ExternalContext through the PipelineContext, but instead create an instance of SimpleExternalContext and use that for the rewriting... All seems to work just fine.

@Erik, could you let me know if this could be a probable solution?



On Tue, May 3, 2011 at 9:18 AM, Jasper Linthorst <[hidden email]> wrote:
Hi Erik,
Thanks for the feedback. Will go with the suggested workaround.

Jasper


On Tue, May 3, 2011 at 6:16 AM, Erik Bruchez <[hidden email]> wrote:
Jasper,

We need to fix this at some point.

As a not-so-nice workaround, you could have your scheduler perform an HTTP request, and implement the PDF generation from that service.

-Erik

On Mon, May 2, 2011 at 6:14 AM, Jasper Linthorst <[hidden email]> wrote:
Hi All,
I've noticed that when I use the 'xhtml-to-pdf' processor from a pipeline that's run through the scheduler it fails at the point where it tries to resolve an external resource (like my css).

It generates a NullPointerException at 
org.orbeon.oxf.processor.pdf.XHTMLToPDFProcessor$1.resolveURI(XHTMLToPDFProcessor.java:77)

Whenever I run the pipeline through an http request (using the pfc) all works fine.

The problem probably has to do with the lack of a ExternalContext/Request object when running a pipeline through the scheduler. Could anyone let me know if there's a workaround to this?

Thanks in advance!

Jasper


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws