You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2004/08/24 07:27:27 UTC

DO NOT REPLY [Bug 30816] New: - ClassCastException thrown in TableLayoutManager.getNextBreakPoss(LayoutContext)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30816>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30816

ClassCastException thrown in TableLayoutManager.getNextBreakPoss(LayoutContext)

           Summary: ClassCastException thrown in
                    TableLayoutManager.getNextBreakPoss(LayoutContext)
           Product: Fop
           Version: 1.0dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: page-master/layout
        AssignedTo: fop-dev@xml.apache.org
        ReportedBy: arthur@istnetworks.com


Using the latest code on the main branch as of 24 Aug ...

The code attempts to cast to a Body object but also needs to deal with a 
BlockLayoutManager (and maybe other types of layout manager???)

Code was modified from
   while ((curLM = (Body)getChildLM()) == null) {

to

   while (true) {
            Object o = getChildLM();
            System.out.println("The object is a " + (o == null? " null " : 
o.getClass().getName()));
            if ((curLM = (Body)o) == null)
            	break;
      
to produce the following output...

The object is a org.apache.fop.layoutmgr.table.Body
The object is a  null 
The object is a org.apache.fop.layoutmgr.table.Body
The object is a org.apache.fop.layoutmgr.table.Body
The object is a  null 
The object is a org.apache.fop.layoutmgr.table.Body
The object is a  null 
The object is a  null 
The object is a org.apache.fop.layoutmgr.BlockLayoutManager

The actual exception being produced is as follows:

Caused by: java.lang.ClassCastException
	at org.apache.fop.layoutmgr.table.TableLayoutManager.getNextBreakPoss
(TableLayoutManager.java:190)
	at org.apache.fop.layoutmgr.BlockLayoutManager.getNextBreakPoss
(BlockLayoutManager.java:204)
	at org.apache.fop.layoutmgr.FlowLayoutManager.getNextBreakPoss
(FlowLayoutManager.java:81)
	at org.apache.fop.layoutmgr.PageLayoutManager.getNextBreakPoss
(PageLayoutManager.java:231)
	at org.apache.fop.layoutmgr.PageLayoutManager.doLayout
(PageLayoutManager.java:195)
	at org.apache.fop.layoutmgr.PageLayoutManager.run
(PageLayoutManager.java:174)
	at org.apache.fop.area.AreaTreeHandler.formatPageSequence
(AreaTreeHandler.java:412)
	at org.apache.fop.area.AreaTreeHandler.endPageSequence
(AreaTreeHandler.java:370)
	at org.apache.fop.fo.pagination.PageSequence.endOfNode
(PageSequence.java:175)
	at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:290)
	at org.apache.xalan.transformer.ResultTreeHandler.endElement
(ResultTreeHandler.java:309)
	at org.apache.xalan.templates.ElemLiteralResult.execute
(ElemLiteralResult.java:716)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes
(ElemApplyTemplates.java:425)
	at org.apache.xalan.templates.ElemApplyTemplates.execute
(ElemApplyTemplates.java:216)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(TransformerImpl.java:2339)