You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Jeff Turner <je...@apache.org> on 2003/09/03 01:19:07 UTC

Cocoon's FOP hardcoded with JAI?

On Tue, Sep 02, 2003 at 11:27:30PM +0200, Christian Geisert wrote:
> jefft@apache.org schrieb:
> >jefft       2003/08/31 02:41:53
> >
> >  Modified:    etc/cocoon_upgrade upgrade_cocoon_jars.sh
> >  Log:
> >  Don't upgrade FOP, as 0.20.5 seems to have a JAI dependency hardcoded
> 
> Huh?
> FOP 0.20.5 is build with JAI and Jimi support but the runtime usage is 
> dynamic which means if JAI is not available then Jimi is used.

It looks like Cocoon's src/blocks/fop/lib/fop-0.20.5.jar was compiled with only
JAI support.  It goes bang when trying to render images with Jimi or when
neither Jimi nor JAI is present:

...
* [0] community/index.pdf
* [0] skin/images/menu-left.gif
* [0] images/remove.jpg
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/jai/codec/FileCacheSeekableStream
        at org.apache.fop.image.JAIImage.loadImage(JAIImage.java:95)
        at org.apache.fop.image.AbstractFopImage.getBitmaps(AbstractFopImage.java:281)
        at org.apache.fop.pdf.PDFXObject.output(PDFXObject.java:233)
        at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:1296)
        at org.apache.fop.render.pdf.PDFRenderer.render(PDFRenderer.java:888)
        at org.apache.fop.apps.StreamRenderer.queuePage(StreamRenderer.java:302)
        at org.apache.fop.layout.AreaTree.addPage(AreaTree.java:108)
        at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:415)
        at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338)
        at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223)
        at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
        at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)

Replacing Cocoon's fop-0.20.5.jar with that from the FOP distribution fixes the
problem.

The CVS log for Cocoon's FOP jar says:

----------------------------
revision 1.3
date: 2003/08/21 01:57:42;  author: joerg;  state: Exp;  lines: +4888 -4746
after update to batik 1.5 rebuild of fop 0.20.5
----------------------------

I'm not sure what this means.  Batik doesn't use FOP does it?  Is it safe for
me to commit the FOP 0.20.5 jar to Cocoon?


--Jeff


> Christian
> 

Re: Using FOP's Batik in Cocoon (Re: Cocoon's FOP hardcoded with JAI?)

Posted by Steven Noels <st...@outerthought.org>.
Joerg Heinicke wrote:

> I know FOP should be built with JAI and JIMI and I thought I have done 
> it. Sorry for any inconvenience.

No problem - it brings a sense of reality about our user base and their 
upgrade frequency, when we discover these things ourselves only after a 
few weeks or so. ;-)

> The remaining question: Is Fop 0.20.5 incompatible to Batik 1.5? Is 
> building a fop.jar for Cocoon the correct way or must we downgrade the 
> Batik version?

 From what I see on forrest-dev, Jeff has switched back to 
batik-1.5b4-fop.jar which comes with FOP. Maybe we should do that as well.

I'm on JDK1.4.1 without need for SVG processing though, so I cannot 
easily test eventual 1.3.1 issues.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source Java & XML            An Orixo Member
Read my weblog at            http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org                stevenn at apache.org


Re: Using FOP's Batik in Cocoon (Re: Cocoon's FOP hardcoded with JAI?)

Posted by Steven Noels <st...@outerthought.org>.
Joerg Heinicke wrote:

> I know FOP should be built with JAI and JIMI and I thought I have done 
> it. Sorry for any inconvenience.

No problem - it brings a sense of reality about our user base and their 
upgrade frequency, when we discover these things ourselves only after a 
few weeks or so. ;-)

> The remaining question: Is Fop 0.20.5 incompatible to Batik 1.5? Is 
> building a fop.jar for Cocoon the correct way or must we downgrade the 
> Batik version?

 From what I see on forrest-dev, Jeff has switched back to 
batik-1.5b4-fop.jar which comes with FOP. Maybe we should do that as well.

I'm on JDK1.4.1 without need for SVG processing though, so I cannot 
easily test eventual 1.3.1 issues.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source Java & XML            An Orixo Member
Read my weblog at            http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org                stevenn at apache.org


Re: Using FOP's Batik in Cocoon (Re: Cocoon's FOP hardcoded with JAI?)

Posted by Joerg Heinicke <jh...@virbus.de>.
The exception below was the reason for building our own FOP and not taking 
the released fop.jar. Immediately before releasing Cocoon 2.1 somebody told 
us that Cocoon's FOP and Batik are incompatible, but a rebuild of FOP using 
Cocoon's Batik helped, so I did it too and committed the fop.jar.

I know FOP should be built with JAI and JIMI and I thought I have done it. 
Sorry for any inconvenience.

The remaining question: Is Fop 0.20.5 incompatible to Batik 1.5? Is building 
a fop.jar for Cocoon the correct way or must we downgrade the Batik version?

Joerg

Jeff Turner wrote:
> On Wed, Sep 10, 2003 at 12:59:07PM +0200, Steven Noels wrote:
> 
>>Jeff Turner wrote:
>>
>>
>>>I'd be interested to know if any other users experience this problem, and
>>>also why Cocoon needs a recompiled FOP jar in the first place.
>>
>>Me too, as I'm experiencing the exact same problem as you described, 
>>with jimi.jar on the classpath. Even worse, there isn't a supported 
>>version of JAI for Mac OSX.
>>
>>With the latest binary release version of FOP, I have no problems at 
>>all, so unless someone objects, I'll revert to that one.
> 
> 
> +1
> 
> While you're at it, we should consider replacing Cocoon's Batik with that
> from FOP 0.20.5.  Building FOP's site with CVS Forrest (fop 0.20.5 +
> Batik from CVS) results in this error:
> 
> * [0] dev/svg/text.svg
> Exception in thread "main" java.lang.NoSuchMethodError: org.apache.batik.bridge.UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context;
>         at org.apache.fop.svg.SVGElement.layout(SVGElement.java:218)
>         at org.apache.fop.fo.flow.InstreamForeignObject.layout(InstreamForeignObject.java:251)
>         at org.apache.fop.fo.flow.Block.layout(Block.java:257)
>         at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154)
> 
> Apparently this is a symptom of FOP requiring its own version of Batik:
> 
> http://archives.real-time.com/pipermail/cocoon-users/2003-June/035132.html
> http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03372.html
> 
> When I switch in FOP's Batik, the problem disappears.  So I've committed
> it for Forrest.
> 
> It's not clear-cut though.  Quoting the first referenced email:
> 
>   "This [using FOP's Batik] may have negative impacts on Cocoons SVG
>   serializer though, so you should not use a PDF generating pipeline
>   which uses embedded or referenced SVGs and a SVG generating pipeline at
>   the same time.
> 
> Cc'ing fop-dev's who better know the pros and cons of this move.
> 
> 
> --Jeff
> 
> 
>></Steven>

-- 
System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


Using FOP's Batik in Cocoon (Re: Cocoon's FOP hardcoded with JAI?)

Posted by Jeff Turner <je...@apache.org>.
On Wed, Sep 10, 2003 at 12:59:07PM +0200, Steven Noels wrote:
> Jeff Turner wrote:
> 
> >I'd be interested to know if any other users experience this problem, and
> >also why Cocoon needs a recompiled FOP jar in the first place.
> 
> Me too, as I'm experiencing the exact same problem as you described, 
> with jimi.jar on the classpath. Even worse, there isn't a supported 
> version of JAI for Mac OSX.
> 
> With the latest binary release version of FOP, I have no problems at 
> all, so unless someone objects, I'll revert to that one.

+1

While you're at it, we should consider replacing Cocoon's Batik with that
from FOP 0.20.5.  Building FOP's site with CVS Forrest (fop 0.20.5 +
Batik from CVS) results in this error:

* [0] dev/svg/text.svg
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.batik.bridge.UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context;
        at org.apache.fop.svg.SVGElement.layout(SVGElement.java:218)
        at org.apache.fop.fo.flow.InstreamForeignObject.layout(InstreamForeignObject.java:251)
        at org.apache.fop.fo.flow.Block.layout(Block.java:257)
        at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154)

Apparently this is a symptom of FOP requiring its own version of Batik:

http://archives.real-time.com/pipermail/cocoon-users/2003-June/035132.html
http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03372.html

When I switch in FOP's Batik, the problem disappears.  So I've committed
it for Forrest.

It's not clear-cut though.  Quoting the first referenced email:

  "This [using FOP's Batik] may have negative impacts on Cocoons SVG
  serializer though, so you should not use a PDF generating pipeline
  which uses embedded or referenced SVGs and a SVG generating pipeline at
  the same time.

Cc'ing fop-dev's who better know the pros and cons of this move.


--Jeff

> 
> </Steven>
> -- 
> Steven Noels                            http://outerthought.org/
> Outerthought - Open Source Java & XML            An Orixo Member
> Read my weblog at            http://blogs.cocoondev.org/stevenn/
> stevenn at outerthought.org                stevenn at apache.org
> 

Using FOP's Batik in Cocoon (Re: Cocoon's FOP hardcoded with JAI?)

Posted by Jeff Turner <je...@apache.org>.
On Wed, Sep 10, 2003 at 12:59:07PM +0200, Steven Noels wrote:
> Jeff Turner wrote:
> 
> >I'd be interested to know if any other users experience this problem, and
> >also why Cocoon needs a recompiled FOP jar in the first place.
> 
> Me too, as I'm experiencing the exact same problem as you described, 
> with jimi.jar on the classpath. Even worse, there isn't a supported 
> version of JAI for Mac OSX.
> 
> With the latest binary release version of FOP, I have no problems at 
> all, so unless someone objects, I'll revert to that one.

+1

While you're at it, we should consider replacing Cocoon's Batik with that
from FOP 0.20.5.  Building FOP's site with CVS Forrest (fop 0.20.5 +
Batik from CVS) results in this error:

* [0] dev/svg/text.svg
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.batik.bridge.UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context;
        at org.apache.fop.svg.SVGElement.layout(SVGElement.java:218)
        at org.apache.fop.fo.flow.InstreamForeignObject.layout(InstreamForeignObject.java:251)
        at org.apache.fop.fo.flow.Block.layout(Block.java:257)
        at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154)

Apparently this is a symptom of FOP requiring its own version of Batik:

http://archives.real-time.com/pipermail/cocoon-users/2003-June/035132.html
http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03372.html

When I switch in FOP's Batik, the problem disappears.  So I've committed
it for Forrest.

It's not clear-cut though.  Quoting the first referenced email:

  "This [using FOP's Batik] may have negative impacts on Cocoons SVG
  serializer though, so you should not use a PDF generating pipeline
  which uses embedded or referenced SVGs and a SVG generating pipeline at
  the same time.

Cc'ing fop-dev's who better know the pros and cons of this move.


--Jeff

> 
> </Steven>
> -- 
> Steven Noels                            http://outerthought.org/
> Outerthought - Open Source Java & XML            An Orixo Member
> Read my weblog at            http://blogs.cocoondev.org/stevenn/
> stevenn at outerthought.org                stevenn at apache.org
> 

Using FOP's Batik in Cocoon (Re: Cocoon's FOP hardcoded with JAI?)

Posted by Jeff Turner <je...@apache.org>.
On Wed, Sep 10, 2003 at 12:59:07PM +0200, Steven Noels wrote:
> Jeff Turner wrote:
> 
> >I'd be interested to know if any other users experience this problem, and
> >also why Cocoon needs a recompiled FOP jar in the first place.
> 
> Me too, as I'm experiencing the exact same problem as you described, 
> with jimi.jar on the classpath. Even worse, there isn't a supported 
> version of JAI for Mac OSX.
> 
> With the latest binary release version of FOP, I have no problems at 
> all, so unless someone objects, I'll revert to that one.

+1

While you're at it, we should consider replacing Cocoon's Batik with that
from FOP 0.20.5.  Building FOP's site with CVS Forrest (fop 0.20.5 +
Batik from CVS) results in this error:

* [0] dev/svg/text.svg
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.batik.bridge.UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context;
        at org.apache.fop.svg.SVGElement.layout(SVGElement.java:218)
        at org.apache.fop.fo.flow.InstreamForeignObject.layout(InstreamForeignObject.java:251)
        at org.apache.fop.fo.flow.Block.layout(Block.java:257)
        at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154)

Apparently this is a symptom of FOP requiring its own version of Batik:

http://archives.real-time.com/pipermail/cocoon-users/2003-June/035132.html
http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03372.html

When I switch in FOP's Batik, the problem disappears.  So I've committed
it for Forrest.

It's not clear-cut though.  Quoting the first referenced email:

  "This [using FOP's Batik] may have negative impacts on Cocoons SVG
  serializer though, so you should not use a PDF generating pipeline
  which uses embedded or referenced SVGs and a SVG generating pipeline at
  the same time.

Cc'ing fop-dev's who better know the pros and cons of this move.


--Jeff

> 
> </Steven>
> -- 
> Steven Noels                            http://outerthought.org/
> Outerthought - Open Source Java & XML            An Orixo Member
> Read my weblog at            http://blogs.cocoondev.org/stevenn/
> stevenn at outerthought.org                stevenn at apache.org
> 

Re: Cocoon's FOP hardcoded with JAI?

Posted by Steven Noels <st...@outerthought.org>.
Jeff Turner wrote:

> I'd be interested to know if any other users experience this problem, and
> also why Cocoon needs a recompiled FOP jar in the first place.

Me too, as I'm experiencing the exact same problem as you described, 
with jimi.jar on the classpath. Even worse, there isn't a supported 
version of JAI for Mac OSX.

With the latest binary release version of FOP, I have no problems at 
all, so unless someone objects, I'll revert to that one.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source Java & XML            An Orixo Member
Read my weblog at            http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org                stevenn at apache.org


Re: Cocoon's FOP hardcoded with JAI?

Posted by Steven Noels <st...@outerthought.org>.
Jeff Turner wrote:

> I'd be interested to know if any other users experience this problem, and
> also why Cocoon needs a recompiled FOP jar in the first place.

Me too, as I'm experiencing the exact same problem as you described, 
with jimi.jar on the classpath. Even worse, there isn't a supported 
version of JAI for Mac OSX.

With the latest binary release version of FOP, I have no problems at 
all, so unless someone objects, I'll revert to that one.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source Java & XML            An Orixo Member
Read my weblog at            http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org                stevenn at apache.org


Re: Cocoon's FOP hardcoded with JAI?

Posted by Jeff Turner <je...@apache.org>.
Following up on this, I am unable to replicate within Cocoon's webapp.
The minimal.fo.xml page renders fine with an embedded image.  So I won't
tinker with src/blocks/fop/lib/*.

However Forrest continues to break when using Cocoon's version of FOP, so
I'll switch Forrest's jar to that from the official 0.20.5 binary.

I'd be interested to know if any other users experience this problem, and
also why Cocoon needs a recompiled FOP jar in the first place.


--Jeff

On Tue, Sep 02, 2003 at 04:19:07PM -0700, Jeff Turner wrote:
> On Tue, Sep 02, 2003 at 11:27:30PM +0200, Christian Geisert wrote:
> > jefft@apache.org schrieb:
> > >jefft       2003/08/31 02:41:53
> > >
> > >  Modified:    etc/cocoon_upgrade upgrade_cocoon_jars.sh
> > >  Log:
> > >  Don't upgrade FOP, as 0.20.5 seems to have a JAI dependency hardcoded
> > 
> > Huh?
> > FOP 0.20.5 is build with JAI and Jimi support but the runtime usage is 
> > dynamic which means if JAI is not available then Jimi is used.
> 
> It looks like Cocoon's src/blocks/fop/lib/fop-0.20.5.jar was compiled with only
> JAI support.  It goes bang when trying to render images with Jimi or when
> neither Jimi nor JAI is present:
> 
> ...
> * [0] community/index.pdf
> * [0] skin/images/menu-left.gif
> * [0] images/remove.jpg
> Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/jai/codec/FileCacheSeekableStream
>         at org.apache.fop.image.JAIImage.loadImage(JAIImage.java:95)
>         at org.apache.fop.image.AbstractFopImage.getBitmaps(AbstractFopImage.java:281)
>         at org.apache.fop.pdf.PDFXObject.output(PDFXObject.java:233)
>         at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:1296)
>         at org.apache.fop.render.pdf.PDFRenderer.render(PDFRenderer.java:888)
>         at org.apache.fop.apps.StreamRenderer.queuePage(StreamRenderer.java:302)
>         at org.apache.fop.layout.AreaTree.addPage(AreaTree.java:108)
>         at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:415)
>         at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338)
>         at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262)
>         at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223)
>         at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
>         at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
> 
> Replacing Cocoon's fop-0.20.5.jar with that from the FOP distribution fixes the
> problem.
> 
> The CVS log for Cocoon's FOP jar says:
> 
> ----------------------------
> revision 1.3
> date: 2003/08/21 01:57:42;  author: joerg;  state: Exp;  lines: +4888 -4746
> after update to batik 1.5 rebuild of fop 0.20.5
> ----------------------------
> 
> I'm not sure what this means.  Batik doesn't use FOP does it?  Is it safe for
> me to commit the FOP 0.20.5 jar to Cocoon?
> 
> 
> --Jeff
> 
> 
> > Christian
> > 

Re: Cocoon's FOP hardcoded with JAI?

Posted by Jeff Turner <je...@apache.org>.
Following up on this, I am unable to replicate within Cocoon's webapp.
The minimal.fo.xml page renders fine with an embedded image.  So I won't
tinker with src/blocks/fop/lib/*.

However Forrest continues to break when using Cocoon's version of FOP, so
I'll switch Forrest's jar to that from the official 0.20.5 binary.

I'd be interested to know if any other users experience this problem, and
also why Cocoon needs a recompiled FOP jar in the first place.


--Jeff

On Tue, Sep 02, 2003 at 04:19:07PM -0700, Jeff Turner wrote:
> On Tue, Sep 02, 2003 at 11:27:30PM +0200, Christian Geisert wrote:
> > jefft@apache.org schrieb:
> > >jefft       2003/08/31 02:41:53
> > >
> > >  Modified:    etc/cocoon_upgrade upgrade_cocoon_jars.sh
> > >  Log:
> > >  Don't upgrade FOP, as 0.20.5 seems to have a JAI dependency hardcoded
> > 
> > Huh?
> > FOP 0.20.5 is build with JAI and Jimi support but the runtime usage is 
> > dynamic which means if JAI is not available then Jimi is used.
> 
> It looks like Cocoon's src/blocks/fop/lib/fop-0.20.5.jar was compiled with only
> JAI support.  It goes bang when trying to render images with Jimi or when
> neither Jimi nor JAI is present:
> 
> ...
> * [0] community/index.pdf
> * [0] skin/images/menu-left.gif
> * [0] images/remove.jpg
> Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/jai/codec/FileCacheSeekableStream
>         at org.apache.fop.image.JAIImage.loadImage(JAIImage.java:95)
>         at org.apache.fop.image.AbstractFopImage.getBitmaps(AbstractFopImage.java:281)
>         at org.apache.fop.pdf.PDFXObject.output(PDFXObject.java:233)
>         at org.apache.fop.pdf.PDFDocument.output(PDFDocument.java:1296)
>         at org.apache.fop.render.pdf.PDFRenderer.render(PDFRenderer.java:888)
>         at org.apache.fop.apps.StreamRenderer.queuePage(StreamRenderer.java:302)
>         at org.apache.fop.layout.AreaTree.addPage(AreaTree.java:108)
>         at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:415)
>         at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338)
>         at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262)
>         at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223)
>         at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
>         at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
> 
> Replacing Cocoon's fop-0.20.5.jar with that from the FOP distribution fixes the
> problem.
> 
> The CVS log for Cocoon's FOP jar says:
> 
> ----------------------------
> revision 1.3
> date: 2003/08/21 01:57:42;  author: joerg;  state: Exp;  lines: +4888 -4746
> after update to batik 1.5 rebuild of fop 0.20.5
> ----------------------------
> 
> I'm not sure what this means.  Batik doesn't use FOP does it?  Is it safe for
> me to commit the FOP 0.20.5 jar to Cocoon?
> 
> 
> --Jeff
> 
> 
> > Christian
> >