ClassCastException when using Table Cells in FOP 0.95B

View: New views
5 Messages — Rating Filter:   Alert me  

ClassCastException when using Table Cells in FOP 0.95B

by Marx, Alexander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hello,

 

I have an issue with Tables in my FOP when using FOP 0.95Beta instead of 0.94

 

None of my Tables work in my FO when using FOP 0.95, i get the following ClassCastExecption:

                              

java.lang.ClassCastException: org.apache.fop.fo.flow.table.TableCell cannot be cast to org.apache.fop.fo.flow.table.ColumnNumberManagerHolder

        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)

        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)

        at org.apache.fop.cli.Main.startFOP(Main.java:166)

        at org.apache.fop.cli.Main.main(Main.java:197)

                              

               

This is an example how i insert a table in the FO:

               

                                               <fo:table border-collapse="separate" border-style="none" padding="2pt" table-layout="fixed" width="100%">

                                                               <fo:table-column column-number="1" column-width="100%"/>

                                                               <fo:table-body>

                                                                              <fo:table-row>

                                                                                              <fo:table-cell vertical-align="top">

                                                                                                              <fo:block column-number="1" font-size="x-large" font-weight="bold" text-align="left">Name1</fo:block>                                   

                                                                                              </fo:table-cell>

                                                                              </fo:table-row>

                                                               </fo:table-body>

                                               </fo:table>

 

It is working well in 0.94 and I want to upgrade to 0.95 because of the updated keep-together features. What could be a possible Reason?

                                              

regards,

Alexander


Re: ClassCastException when using Table Cells in FOP 0.95B

by Vincent Hennebert-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alexander,

Marx, Alexander wrote:

> Hello,
>
> I have an issue with Tables in my FOP when using FOP 0.95Beta instead of
> 0.94
>
> <fo:table
> border-collapse="separate" border-style="none" padding="2pt"
> table-layout="fixed" width="100%">
> <fo:table-column column-number="1" column-width="100%"/>
> <fo:table-body>
> <fo:table-row>
> <fo:table-cell vertical-align="top">
> <fo:block column-number="1" font-size="x-large" font-weight="bold"
> text-align="left">Name1</fo:block>                                    
> </fo:table-cell>
> </fo:table-row>
> </fo:table-body>
> </fo:table>

You specified the column-number property on an element that doesn’t
support it (fo:block). I guess you wanted to set it on the parent
fo:table-cell element (although here it’s not needed). column-number
only applies to fo:table-column and fo:table-cell.

FOP lacks of robustness here since it crashes instead of just giving
a warning that column-number doesn’t apply to fo:block. Can you please
create a bug report on Bugzilla, attaching a complete FO file containing
your snippet above as an example?
https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop

This will help us to keep track of the issue. Thanks!

For now, if you just remove column-number from the fo:block your FO file
will render fine.


HTH,
Vincent


--
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@...
For additional commands, e-mail: fop-users-help@...


Parent Message unknown Re: ClassCastException when using Table Cells in FOP 0.95B

by Andreas Delmelle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>----- Oorspronkelijk bericht -----
>Van: Vincent Hennebert [mailto:vincent.hennebert@...]
>Verzonden: vrijdag, juni 13, 2008 12:17 PM
>
<snip />
>
>FOP lacks of robustness here since it crashes instead of just giving
>a warning that column-number doesn’t apply to fo:block. Can you please
>create a bug report on Bugzilla, attaching a complete FO file containing
>your snippet above as an example?
>https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop
>
>This will help us to keep track of the issue. Thanks!

This is a very easy fix. I'll see if I can take care of it ASAP. I just checked the SVN history of the related source file, and apparently, I had initially added such a check in the wrong place (ColumnNumberPropertyMaker.make(PropertyList), which is normally only called to 'make' implicit values; removed in the meantime). The check should still be made, however, in make(PropertyList, String, FObj), so that it is instead called when making the property off an explicitly specified value.

Cheers

Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@...
For additional commands, e-mail: fop-users-help@...


Re: ClassCastException when using Table Cells in FOP 0.95B

by Andreas Delmelle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 13, 2008, at 13:18, Andreas Delmelle wrote:

>> ----- Oorspronkelijk bericht -----
>> Van: Vincent Hennebert [mailto:vincent.hennebert@...]
>> Verzonden: vrijdag, juni 13, 2008 12:17 PM
>>
> <snip />
>>
>> FOP lacks of robustness here since it crashes instead of just giving
>> a warning that column-number doesn’t apply to fo:block. Can you  
>> please
>> create a bug report on Bugzilla, attaching a complete FO file  
>> containing
>> your snippet above as an example?
>> https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop
>>
>> This will help us to keep track of the issue. Thanks!
>
> This is a very easy fix. I'll see if I can take care of it ASAP. I  
> just checked the SVN history of the related source file, and  
> apparently, I had initially added such a check in the wrong place  
> (ColumnNumberPropertyMaker.make(PropertyList), which is normally  
> only called to 'make' implicit values; removed in the meantime).  
> The check should still be made, however, in make(PropertyList,  
> String, FObj), so that it is instead called when making the  
> property off an explicitly specified value.

Just found this little TODO on my list. Apparently, it was never  
logged in Bugzilla. The fix got inadvertently committed to the Trunk  
with r670412. I have now also added a small check for this in the  
fotree testsuite, so it doesn't get lost.

see:
http://svn.apache.org/viewvc?rev=670412&view=rev
http://svn.apache.org/viewvc?rev=672833&view=rev


Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@...
For additional commands, e-mail: fop-users-help@...


Re: ClassCastException when using Table Cells in FOP 0.95B

by Andreas Delmelle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 30, 2008, at 19:38, Andreas Delmelle wrote:

> On Jun 13, 2008, at 13:18, Andreas Delmelle wrote:
>>> <snip />
>> This is a very easy fix. I'll see if I can take care of it ASAP. I  
>> just checked the SVN history of the related source file, and  
>> apparently, I had initially added such a check in the wrong place  
>> (ColumnNumberPropertyMaker.make(PropertyList), which is normally  
>> only called to 'make' implicit values; removed in the meantime).  
>> The check should still be made, however, in make(PropertyList,  
>> String, FObj), so that it is instead called when making the  
>> property off an explicitly specified value.
>
> Just found this little TODO on my list. Apparently, it was never  
> logged in Bugzilla. The fix got inadvertently committed to the  
> Trunk with r670412. I have now also added a small check for this in  
> the fotree testsuite, so it doesn't get lost.
>
> see:
>
> http://svn.apache.org/viewvc?rev=672833&view=rev

Noticed yesterday that the fix did not make it into the trunk after  
all... Went unnoticed for a couple of days; must be the holidays. ;-)

Rectified as of:
http://svn.apache.org/viewvc?rev=674245&view=rev


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@...
For additional commands, e-mail: fop-users-help@...