Bug 41448 - java.lang.ClassCastException: org.apache.fop.layoutmgr.inline.WrapperLayoutManager
Summary: java.lang.ClassCastException: org.apache.fop.layoutmgr.inline.WrapperLayoutMa...
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: 0.93
Hardware: All All
: P1 blocker
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 21:18 UTC by Steve Whitlatch
Modified: 2012-04-01 06:30 UTC (History)
0 users



Attachments
broken.xml reproduces this error, works.xml works. Includes .fo files (5.44 KB, application/zip)
2007-01-25 00:29 UTC, Daniel Weber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Whitlatch 2007-01-23 21:18:42 UTC
Using DocBook XML 4.5 (test.xml, below), DocBook XSL 1.71.1 (test.xsl, below),
and xsltproc 
 xsltproc --version
Using libxml 20626, libxslt 10117 and libexslt 813
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813
libxslt 10117 was compiled against libxml 20626
libexslt 813 was compiled against libxml 20626

consistently getting this error (partial listing here, full listing at bottom)
on both cygwin and Linux:

Jan 23, 2007 9:56:49 PM org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException:
org.apache.fop.layoutmgr.inline.WrapperLayoutManager
Jan 23, 2007 9:56:49 PM org.apache.fop.cli.Main startFOP
SEVERE: Exception
javax.xml.transform.TransformerException: java.lang.ClassCastException:
org.apache.fop.layoutmgr.inline.WrapperLayoutManager
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)

*****************************
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<book>
  <chapter><title></title>
    <indexterm><primary></primary></indexterm>
  </chapter>
</book>
********************



********************
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version="1.0">
  <xsl:import href="/usr/share/xml/docbook/xsl-stylesheets-1.71-1/fo/docbook.xsl
"/>
  <xsl:param name="fop1.extensions" select="1"/>
  <xsl:param name="use.svg" select="1"></xsl:param>
  <xsl:param name="draft.mode" select="no"/>

</xsl:stylesheet>
********************


*************** full error listing, happens every time ***************
*********** seems to me it could only be an FOP error *************
********** my apologies if not ******************

Making portrait pages on USletter paper (8.5inx11in)
Jan 23, 2007 10:15:16 PM org.apache.fop.cli.InputHandler error
SEVERE: javax.xml.transform.TransformerException:
org.apache.fop.layoutmgr.inline.WrapperLayoutManager
Jan 23, 2007 10:15:16 PM org.apache.fop.cli.Main startFOP
SEVERE: Exception
javax.xml.transform.TransformerException: java.lang.ClassCastException:
org.apache.fop.layoutmgr.inline.WrapperLayoutManager
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)

---------

javax.xml.transform.TransformerException: java.lang.ClassCastException:
org.apache.fop.layoutmgr.inline.WrapperLayoutManager
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:647)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)
Caused by: java.lang.ClassCastException:
org.apache.fop.layoutmgr.inline.WrapperLayoutManager
        at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:76)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthElements(PageSequenceLayoutManager.java:272)
        at
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:554)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList(PageSequenceLayoutManager.java:264)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:301)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:263)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:157)
        at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:385)
        at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:148)
        at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
        at
com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:262)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:557)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:638)
        ... 5 more
---------
java.lang.ClassCastException: org.apache.fop.layoutmgr.inline.WrapperLayoutManager
        at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:76)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthElements(PageSequenceLayoutManager.java:272)
        at
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:554)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList(PageSequenceLayoutManager.java:264)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:301)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:263)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:157)
        at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:385)
        at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:148)
        at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
        at
com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:262)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:557)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:638)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)
Comment 1 Steve Whitlatch 2007-01-23 21:21:17 UTC
Test files in description, made as small as possible to still produce the error.
Comment 2 Chris Bowditch 2007-01-24 06:00:13 UTC
You've haven't attached the XSL-FO that is generated by docbook which we will 
need for us to make an accurate diagnosis of the problem. If I had to guess 
then I would say this is caused by an fo:wrapper element as an immediate child 
of fo:flow. This bug exists in the released 0.93 but has been fixed in SVN.
Comment 3 Daniel Weber 2007-01-25 00:29:01 UTC
Created attachment 19453 [details]
broken.xml reproduces this error, works.xml works. Includes .fo files

Used xsltproc:
   B:\>xsltproc --version
   Using libxml 20619CVS2407, libxslt 10114CVS1012 and libexslt 812CVS1012
   xsltproc was compiled against libxml 20619, libxslt 10114 and libexslt 812
   libxslt 10114 was compiled against libxml 20619
   libexslt 812 was compiled against libxml 20619

DocBook XSL Stylesheets 1.71.1

fop-0.93
Comment 4 Chris Bowditch 2007-01-25 01:50:42 UTC
The FO generated by docbook contains fo:wrapper elements as direct children of 
fo:flow, e.g.

<fo:wrapper id="id91268">
	<!--index term-->
</fo:wrapper>

In 0.93 this is the cause of the ClassCastException. The ClassCastException 
has been fixed in SVN. But the id attribute has no affect on an fo:wrapper in 
FOP currently. I guess docbook generates this as a placeholder for PDF 
destinations. If you don't care about PDF destinations and just want to 
overcome the ClassCastException then get an SVN client, download the code and 
compile it yourself. If you don't fancy doing that then you may want to tell 
the docbook folks about this problem. Maybe when fop1.extensions is set they 
could skip generating such fo:wrapper elements for PDF Destinations, since PDF 
Destinations aren't supported in FOP anyway.

I'm closing this bug as the ClassCastException is fixed.
Comment 5 Glenn Adams 2012-04-01 06:30:07 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed