You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Brian Trezise <Br...@IntelliData.net> on 2008/08/25 22:41:14 UTC

XSL caching question

In FOP 0.95, I'm using the basic caching method to cache my XSL
transformation file, not doing anything fancy with file system monitors or
anything for the time being.  The first time I run FOP on the server to
generate a pdf, it takes 10-20 seconds to generate the pdf because it's
loading up the XSL file for the first run.  Afterwards it runs in the
neighborhood of 500ms per PDF.  I was just wondering if there is a way to
force the XSL to fully cache statically?

This isn't a huge issue as we don't restart our servers all that often but
it's just a little thing that's bugging me J

Thanks,

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
22288 E Princeton Dr
aurora, colorado 80018
T: 720.524.4864
brian.trezise@intellidata.net

 


RE: Create damaged PDF file

Posted by "Hu, Zemin" <Ze...@adp.com>.
The template file is huge, it involves around 30 tables(many complicated tables), and the error message does not indicate line numbers in the template (could this be improved so we can have clue?), so it is very hard to guess which table is causing problem, also it may well not be the cause of the problem since the file could be generated successfully next time using same template and same data. Another guess I have is that the template and data are out of sync at that moment for some reason-timing, cache, whatever, just wild imagination.

Thanks.

Zemin

From: Peter Hancock [mailto:peter.hancock@gmail.com]
Sent: Friday, January 22, 2010 12:15 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi Zemin,

Are you able to extract a  snippet of the fo that is supposedly missing this child element?  If you can show that the fo is indeed well formed it would support the argument that the problem is in FOP.

Thanks,

Pete
On Fri, Jan 22, 2010 at 5:05 PM, Hu, Zemin <Ze...@adp.com>> wrote:
I am new here and have a question.

I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".

When I read log file, I can find error message:
SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)

The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug.

This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.

Any suggestions or solutions?

Thanks.

Zemin

----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org<ma...@xmlgraphics.apache.org>
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org<ma...@xmlgraphics.apache.org>


Re: Create damaged PDF file

Posted by Peter Hancock <pe...@gmail.com>.
Hi Zemin,

Are you able to extract a  snippet of the fo that is supposedly missing this
child element?  If you can show that the fo is indeed well formed it would
support the argument that the problem is in FOP.

Thanks,

Pete

On Fri, Jan 22, 2010 at 5:05 PM, Hu, Zemin <Ze...@adp.com> wrote:

> I am new here and have a question.
>
> I am creating PDF on the fly for a web application. A PDF file is supposed
> to open when user clicks on a link. Occasionally the created PDF file cannot
> be opened and the error message says: "File is damaged and could not be
> repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error
> unknown)org.apache.fop.fo.ValidationException: Error(Unknown location):
> fo:table-row is missing child elements. Required Content Model:
> (table-cell+)
>
> The weird thing is that this error only happens at first time or first few
> times, then the PDF file generation goes fine. Then if user browses other
> pages and comes back, this can happen again. This error is not consistent,
> sometimes everything is just fine. This is really frustrating and hard to
> debug.
>
> This never happened in my unit test and local environment. So I am thinking
> it might be the cache issue or web server configuration issue. But I have no
> clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>
> ----------------------------------------------------------------------
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an authorized
> representative of the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, notify the sender immediately by
> return email and delete the message and any attachments from your system.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

RE: XSL caching question

Posted by tamugrg <sa...@auspost.com.au>.
Hi Sean,

Thanks for your response. My code basically is what you've suggested. I use
static initialisers & load the templates in the static block. It seems to be
doing it at server startup because of the log messages that gets printed out
& also by the fact that the templates do get used (doesn't look like it is
creating new ones) when the PDF document is generated. BUT the PDF
generation is still slower the first time the xsl style sheets are being
used.

I am thinking of trying out the XSLT compiler as pointed out in 
http://xmlgraphics.apache.org/fop/0.95/embedding.html#performance

My concern is the comment:

Although the XSLTC developers make every effort to avoid changes that affect
binary compatibility, we cannot guarantee that a translet will work with any
version of the run-time processor other than the one that corresponds to the
version of the XSLTC compiler that was used to create the translet.

in the description on whether any upgrade of java version would have any
impact? or would it be just the version of the XSLT compiler?

Cheers,



Griffin,Sean wrote:
> 
> Tamu,
> Based simply on the code sample that Brian provided in his original post
> over a year ago, the XSL will only be "compiled" when the class containing
> that static initializer is loaded.  That class won't be loaded until it's
> used, so your first run is always going to include both compilation and
> transformation time while subsequent runs will just include
> transformation.  Couple that with the fact that even after compilation
> there is undoubtedly other caching and potential class loading going on by
> both the JVM and OS when you do the first transformation.  And finally,
> Brian's original post coupled the XSLT transformation with the FOP
> rendering; these are separate processes and FOP does not control how you
> use the XSLT to get to the XSL-FO it needs.
> 
> Assuming your code is like Brian's, it's doing what it's supposed to do
> (though I personally don't like static initializers myself because of the
> exception-eating that goes on if there's an error in the stylesheet that
> causes it to not compile).  If you want to perform the stylesheet
> compilation before the first run you need to put it in a method that gets
> called from the lifecycle hooks in your application.  Assuming this is in
> a web application, you can do it in the
> ServletContextListener.contextInitialized method.
> 
> Sean
> 
> -----Original Message-----
> From: tamugrg [mailto:sagun.gurung@auspost.com.au] 
> Sent: Friday, January 22, 2010 6:34 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: RE: XSL caching question
> 
> 
> Hi,
> 
> I am facing exactly the same issue. The first time the XSL gets used, it
> takes quite a bit of time to do the transformation. After that the
> transformations happen much faster. I am using templates as described in
> this thread & assume the style sheet should be cached. But from the
> behaviour that it takes longer the first time the XSLs are being used &
> subsequently takes lesser time indicates that probably it's not been
> catched.
> 
> Any suggestions/experience on this is very much appreciated.
> 
> Cheers,
> tamu
> 
> 
> 
> Brian Trezise wrote:
>> 
>> Silly me, going to be hard for you guys to answer my question if you
>> don't
>> have a code sample to look at J
>> 
>> 
>> 
>> 
>>    static
>> 
>>    {
>> 
>>       try
>> 
>>       {
>> 
>>          cyberTron = TransformerFactory.newInstance();
>> 
>>          Config config = (Config)
>> ConfigManager.getInstance().getConfig(Config.class);
>> 
>>          Source xslt = new StreamSource(new
>> File(config.getXSLTemplateURL()));
>> 
>>          allSpark = cyberTron.newTemplates(xslt);
>> 
>>       }
>> 
>>       catch(Exception e)
>> 
>>       {
>> 
>>          logger.error(e);
>> 
>>       }
>> 
>>    }
>> 
>>  
>> 
>> ~Brian
>> 
>> ___________________________________________________
>> Brian Trezise
>> Staff Software Engineer
>> IntelliData, Inc
>> 22288 E Princeton Dr
>> aurora, colorado 80018
>> T: 720.524.4864
>> brian.trezise@intellidata.net
>> 
>>  
>> 
>> From: Brian Trezise [mailto:Brian.Trezise@IntelliData.net] 
>> Sent: Monday, August 25, 2008 2:41 PM
>> To: fop-users@xmlgraphics.apache.org
>> Subject: XSL caching question
>> 
>>  
>> 
>> In FOP 0.95, I'm using the basic caching method to cache my XSL
>> transformation file, not doing anything fancy with file system monitors
>> or
>> anything for the time being.  The first time I run FOP on the server to
>> generate a pdf, it takes 10-20 seconds to generate the pdf because it's
>> loading up the XSL file for the first run.  Afterwards it runs in the
>> neighborhood of 500ms per PDF.  I was just wondering if there is a way to
>> force the XSL to fully cache statically?
>> 
>> This isn't a huge issue as we don't restart our servers all that often
>> but
>> it's just a little thing that's bugging me J
>> 
>> Thanks,
>> 
>> ___________________________________________________
>> Brian Trezise
>> Staff Software Engineer
>> IntelliData, Inc
>> 22288 E Princeton Dr
>> aurora, colorado 80018
>> T: 720.524.4864
>> brian.trezise@intellidata.net
>> 
>>  
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://old.nabble.com/XSL-caching-question-tp19151328p27272536.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> ----------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are from
> Cerner Corporation and are intended only for the addressee. The
> information contained in this message is confidential and may constitute
> inside or non-public information under international, federal, or state
> securities laws. Unauthorized forwarding, printing, copying, distribution,
> or use of such information is strictly prohibited and may be unlawful. If
> you are not the addressee, please promptly delete this message and notify
> the sender of the delivery error by e-mail or you may call Cerner's
> corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/XSL-caching-question-tp19151328p27300720.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: Create damaged PDF file

Posted by "Hu, Zemin" <Ze...@adp.com>.
I will take another good look of my humongous XSL file then. I don't seem to have any other choice.

Thanks.

Zemin

-----Original Message-----
From: Georg Datterl [mailto:georg.datterl@geneon.de] 
Sent: Tuesday, January 26, 2010 4:02 AM
To: fop-users@xmlgraphics.apache.org
Subject: AW: Create damaged PDF file

Hi Zemin, 

Yes, that was understood. Still you need at least one fo-file which produces the error, from there you can start looking for the reason. I did quite some ugly things with tables but whenever I got this error, it always was because indeed there were rows without cells.

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com] 
Gesendet: Montag, 25. Januar 2010 18:33
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

Maybe I should make it clear again: I get the same FOP error message from exact same set of data(XML) and same template and it only happens once in a while. I am not sure the error message was generated from different tables or same table. Worst thing is that I cannot re-create this in my unit test and local server environment.

Zemin
-----Original Message-----
From: Georg Datterl [mailto:georg.datterl@geneon.de]
Sent: Monday, January 25, 2010 10:32 AM
To: fop-users@xmlgraphics.apache.org
Subject: AW: Create damaged PDF file

Hi Zemin, 

first you need to get your hands on a fo file which produces the error. From there you can work your ways back into xml to find where the error is produced. The error message clearly states you have a table row without table cells. I don't think you can avoid going through your file and find this row...

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com]
Gesendet: Montag, 25. Januar 2010 16:27
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.

Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr]
Sent: Monday, January 25, 2010 4:06 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,
as the error message said, you have an empty fo:table-row in the resulting XSL-FO file.
I guess you use a XML + XSLT couple to get such file, therefore you should debug your XSLT to produce a clean, valid XSL-FO code.

An alternative is to configure FOP to be more "laxist". See "strict-configuration" option in FOP configuration [1].

[1]
http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements

HTH,
Pascal

Hu, Zemin a écrit :
> I am new here and have a question. 
>
> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>
> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>
> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>   


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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

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


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


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


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


AW: Create damaged PDF file

Posted by Georg Datterl <ge...@geneon.de>.
Hi Zemin, 

Yes, that was understood. Still you need at least one fo-file which produces the error, from there you can start looking for the reason. I did quite some ugly things with tables but whenever I got this error, it always was because indeed there were rows without cells.

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com] 
Gesendet: Montag, 25. Januar 2010 18:33
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

Maybe I should make it clear again: I get the same FOP error message from exact same set of data(XML) and same template and it only happens once in a while. I am not sure the error message was generated from different tables or same table. Worst thing is that I cannot re-create this in my unit test and local server environment.

Zemin
-----Original Message-----
From: Georg Datterl [mailto:georg.datterl@geneon.de]
Sent: Monday, January 25, 2010 10:32 AM
To: fop-users@xmlgraphics.apache.org
Subject: AW: Create damaged PDF file

Hi Zemin, 

first you need to get your hands on a fo file which produces the error. >From there you can work your ways back into xml to find where the error is produced. The error message clearly states you have a table row without table cells. I don't think you can avoid going through your file and find this row...

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com]
Gesendet: Montag, 25. Januar 2010 16:27
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.

Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr]
Sent: Monday, January 25, 2010 4:06 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,
as the error message said, you have an empty fo:table-row in the resulting XSL-FO file.
I guess you use a XML + XSLT couple to get such file, therefore you should debug your XSLT to produce a clean, valid XSL-FO code.

An alternative is to configure FOP to be more "laxist". See "strict-configuration" option in FOP configuration [1].

[1]
http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements

HTH,
Pascal

Hu, Zemin a écrit :
> I am new here and have a question. 
>
> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>
> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>
> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>   


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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

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


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


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


RE: Create damaged PDF file

Posted by "Hu, Zemin" <Ze...@adp.com>.
Maybe I should make it clear again: I get the same FOP error message from exact same set of data(XML) and same template and it only happens once in a while. I am not sure the error message was generated from different tables or same table. Worst thing is that I cannot re-create this in my unit test and local server environment.

Zemin
-----Original Message-----
From: Georg Datterl [mailto:georg.datterl@geneon.de] 
Sent: Monday, January 25, 2010 10:32 AM
To: fop-users@xmlgraphics.apache.org
Subject: AW: Create damaged PDF file

Hi Zemin, 

first you need to get your hands on a fo file which produces the error. From there you can work your ways back into xml to find where the error is produced. The error message clearly states you have a table row without table cells. I don't think you can avoid going through your file and find this row...

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com] 
Gesendet: Montag, 25. Januar 2010 16:27
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.

Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr]
Sent: Monday, January 25, 2010 4:06 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,
as the error message said, you have an empty fo:table-row in the resulting XSL-FO file.
I guess you use a XML + XSLT couple to get such file, therefore you should debug your XSLT to produce a clean, valid XSL-FO code.

An alternative is to configure FOP to be more "laxist". See "strict-configuration" option in FOP configuration [1].

[1]
http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements

HTH,
Pascal

Hu, Zemin a écrit :
> I am new here and have a question. 
>
> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>
> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>
> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>   


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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

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


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


AW: Create damaged PDF file

Posted by Georg Datterl <ge...@geneon.de>.
Hi Zemin, 

first you need to get your hands on a fo file which produces the error. >From there you can work your ways back into xml to find where the error is produced. The error message clearly states you have a table row without table cells. I don't think you can avoid going through your file and find this row...

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com] 
Gesendet: Montag, 25. Januar 2010 16:27
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.

Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr]
Sent: Monday, January 25, 2010 4:06 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,
as the error message said, you have an empty fo:table-row in the resulting XSL-FO file.
I guess you use a XML + XSLT couple to get such file, therefore you should debug your XSLT to produce a clean, valid XSL-FO code.

An alternative is to configure FOP to be more "laxist". See "strict-configuration" option in FOP configuration [1].

[1]
http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements

HTH,
Pascal

Hu, Zemin a écrit :
> I am new here and have a question. 
>
> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>
> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>
> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>   


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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

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


Re: Create damaged PDF file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 27.01.2010 16:11:52 Hu, Zemin wrote:
> Thanks for suggestions. Please understand the data definitely stays the same in between clicks.
> Couple of concerns:
> 1. I did two steps PDF generation when I was at concept proof stage, I found the intermediate fo file was huge and not useful, another reason is that it impairs performance. So I abandoned doing that. I am not sure this helps due to the nature of the randomness of the error.

But keeping it at two steps for now would allow you to determine if the
problem is on the XSLT side or the FOP side. It sounds a lot like a
multi-threading problem.

> 2. If I turn off validation, is it possible to cause more bad PDF generations? I am just speculating.
> 
> Thanks.
> 
> Zemin
> 
> -----Original Message-----
> From: Pascal Sancho [mailto:pascal.sancho@takoma.fr] 
> Sent: Monday, January 25, 2010 10:47 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Create damaged PDF file
> 
> Hi,
> 
> Hu, Zemin a écrit :
> > I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.
> >   
> If the message disappears between 2 runs, that means that something has
> changed in the XML source (or less probably in the XSLT).
> 
> A good practice here is to separate the full transformation into 2 stages:
> 1/ XSLT transformation (invoking Xalan directly, for example) and get
> the XSL-FO file
> 2/ PDF generation, invoking FOP with the produced XSL-FO.
> 
> Benefits:
>  - you can inspect (and reformat for better readability) the XSL-FO file
>  - FOP can know the exact location where the error occurs, and send it
> to you in the error message.
>  - FOP list can help you more efficiently.
> 
> > Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.
> >   
> My bad, this option is for configuation file.
> What I wanted to point to was the [strict-validation] option, witch
> default to true.
> 
> > Zemin
> >
> > -----Original Message-----
> > Hi,
> > as the error message said, you have an empty fo:table-row in the
> > resulting XSL-FO file.
> > I guess you use a XML + XSLT couple to get such file, therefore you
> > should debug your XSLT to produce a clean, valid XSL-FO code.
> >
> > An alternative is to configure FOP to be more "laxist". See
> > "strict-configuration" option in FOP configuration [1].
> >
> > [1]
> > http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements
> >
> > HTH,
> > Pascal
> >
> > Hu, Zemin a écrit :
> >   
> >> I am new here and have a question. 
> >>
> >> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
> >>
> >> When I read log file, I can find error message:
> >> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
> >>
> >> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
> >>
> >> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
> >>
> >> Any suggestions or solutions?
> >>
> >> Thanks.
> >>
> >> Zemin
> >>     
> Pascal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> ----------------------------------------------------------------------
> This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.




Jeremias Maerki


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


AW: Create damaged PDF file

Posted by Georg Datterl <ge...@geneon.de>.
Hi Zemin, 

I may be wrong, but from my experience randomness is just a sign of an unexpected factor.

Mit freundlichen Grüßen
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Hu, Zemin [mailto:Zemin_Hu@adp.com] 
Gesendet: Mittwoch, 27. Januar 2010 16:12
An: fop-users@xmlgraphics.apache.org
Betreff: RE: Create damaged PDF file

Thanks for suggestions. Please understand the data definitely stays the same in between clicks.
Couple of concerns:
1. I did two steps PDF generation when I was at concept proof stage, I found the intermediate fo file was huge and not useful, another reason is that it impairs performance. So I abandoned doing that. I am not sure this helps due to the nature of the randomness of the error.
2. If I turn off validation, is it possible to cause more bad PDF generations? I am just speculating.

Thanks.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr]
Sent: Monday, January 25, 2010 10:47 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,

Hu, Zemin a écrit :
> I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.
>   
If the message disappears between 2 runs, that means that something has changed in the XML source (or less probably in the XSLT).

A good practice here is to separate the full transformation into 2 stages:
1/ XSLT transformation (invoking Xalan directly, for example) and get the XSL-FO file 2/ PDF generation, invoking FOP with the produced XSL-FO.

Benefits:
 - you can inspect (and reformat for better readability) the XSL-FO file
 - FOP can know the exact location where the error occurs, and send it to you in the error message.
 - FOP list can help you more efficiently.

> Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.
>   
My bad, this option is for configuation file.
What I wanted to point to was the [strict-validation] option, witch default to true.

> Zemin
>
> -----Original Message-----
> Hi,
> as the error message said, you have an empty fo:table-row in the 
> resulting XSL-FO file.
> I guess you use a XML + XSLT couple to get such file, therefore you 
> should debug your XSLT to produce a clean, valid XSL-FO code.
>
> An alternative is to configure FOP to be more "laxist". See 
> "strict-configuration" option in FOP configuration [1].
>
> [1]
> http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elem
> ents
>
> HTH,
> Pascal
>
> Hu, Zemin a écrit :
>   
>> I am new here and have a question. 
>>
>> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>>
>> When I read log file, I can find error message:
>> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>>
>> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>>
>> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>>
>> Any suggestions or solutions?
>>
>> Thanks.
>>
>> Zemin
>>     
Pascal

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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

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


RE: Create damaged PDF file

Posted by "Hu, Zemin" <Ze...@adp.com>.
Thanks for suggestions. Please understand the data definitely stays the same in between clicks.
Couple of concerns:
1. I did two steps PDF generation when I was at concept proof stage, I found the intermediate fo file was huge and not useful, another reason is that it impairs performance. So I abandoned doing that. I am not sure this helps due to the nature of the randomness of the error.
2. If I turn off validation, is it possible to cause more bad PDF generations? I am just speculating.

Thanks.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr] 
Sent: Monday, January 25, 2010 10:47 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,

Hu, Zemin a écrit :
> I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.
>   
If the message disappears between 2 runs, that means that something has
changed in the XML source (or less probably in the XSLT).

A good practice here is to separate the full transformation into 2 stages:
1/ XSLT transformation (invoking Xalan directly, for example) and get
the XSL-FO file
2/ PDF generation, invoking FOP with the produced XSL-FO.

Benefits:
 - you can inspect (and reformat for better readability) the XSL-FO file
 - FOP can know the exact location where the error occurs, and send it
to you in the error message.
 - FOP list can help you more efficiently.

> Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.
>   
My bad, this option is for configuation file.
What I wanted to point to was the [strict-validation] option, witch
default to true.

> Zemin
>
> -----Original Message-----
> Hi,
> as the error message said, you have an empty fo:table-row in the
> resulting XSL-FO file.
> I guess you use a XML + XSLT couple to get such file, therefore you
> should debug your XSLT to produce a clean, valid XSL-FO code.
>
> An alternative is to configure FOP to be more "laxist". See
> "strict-configuration" option in FOP configuration [1].
>
> [1]
> http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements
>
> HTH,
> Pascal
>
> Hu, Zemin a écrit :
>   
>> I am new here and have a question. 
>>
>> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>>
>> When I read log file, I can find error message:
>> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>>
>> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>>
>> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>>
>> Any suggestions or solutions?
>>
>> Thanks.
>>
>> Zemin
>>     
Pascal

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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

Re: Create damaged PDF file

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,

Hu, Zemin a écrit :
> I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.
>   
If the message disappears between 2 runs, that means that something has
changed in the XML source (or less probably in the XSLT).

A good practice here is to separate the full transformation into 2 stages:
1/ XSLT transformation (invoking Xalan directly, for example) and get
the XSL-FO file
2/ PDF generation, invoking FOP with the produced XSL-FO.

Benefits:
 - you can inspect (and reformat for better readability) the XSL-FO file
 - FOP can know the exact location where the error occurs, and send it
to you in the error message.
 - FOP list can help you more efficiently.

> Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.
>   
My bad, this option is for configuation file.
What I wanted to point to was the [strict-validation] option, witch
default to true.

> Zemin
>
> -----Original Message-----
> Hi,
> as the error message said, you have an empty fo:table-row in the
> resulting XSL-FO file.
> I guess you use a XML + XSLT couple to get such file, therefore you
> should debug your XSLT to produce a clean, valid XSL-FO code.
>
> An alternative is to configure FOP to be more "laxist". See
> "strict-configuration" option in FOP configuration [1].
>
> [1]
> http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements
>
> HTH,
> Pascal
>
> Hu, Zemin a écrit :
>   
>> I am new here and have a question. 
>>
>> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>>
>> When I read log file, I can find error message:
>> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>>
>> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>>
>> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>>
>> Any suggestions or solutions?
>>
>> Thanks.
>>
>> Zemin
>>     
Pascal

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


RE: Create damaged PDF file

Posted by "Hu, Zemin" <Ze...@adp.com>.
I am using XML+XSLT combination as you indicated, but the error message is NOT consistent, it may disappear on next run, so I don't know how to debug my template to be clean since it is clean most of the time.

Thanks for pointing out to me the configuration option, I was going to test, but after reading document from your URL, I found it won't help in this case because the default value for "strict-configuration" option is "false" already.

Zemin

-----Original Message-----
From: Pascal Sancho [mailto:pascal.sancho@takoma.fr] 
Sent: Monday, January 25, 2010 4:06 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Create damaged PDF file

Hi,
as the error message said, you have an empty fo:table-row in the
resulting XSL-FO file.
I guess you use a XML + XSLT couple to get such file, therefore you
should debug your XSLT to produce a clean, valid XSL-FO code.

An alternative is to configure FOP to be more "laxist". See
"strict-configuration" option in FOP configuration [1].

[1]
http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements

HTH,
Pascal

Hu, Zemin a écrit :
> I am new here and have a question. 
>
> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>
> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>
> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>   


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


----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

Re: Create damaged PDF file

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,
as the error message said, you have an empty fo:table-row in the
resulting XSL-FO file.
I guess you use a XML + XSLT couple to get such file, therefore you
should debug your XSLT to produce a clean, valid XSL-FO code.

An alternative is to configure FOP to be more "laxist". See
"strict-configuration" option in FOP configuration [1].

[1]
http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements

HTH,
Pascal

Hu, Zemin a écrit :
> I am new here and have a question. 
>
> I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".
>
> When I read log file, I can find error message:
> SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)
>
> The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 
>
> This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.
>
> Any suggestions or solutions?
>
> Thanks.
>
> Zemin
>   


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


Create damaged PDF file

Posted by "Hu, Zemin" <Ze...@adp.com>.
I am new here and have a question. 

I am creating PDF on the fly for a web application. A PDF file is supposed to open when user clicks on a link. Occasionally the created PDF file cannot be opened and the error message says: "File is damaged and could not be repaired".

When I read log file, I can find error message:
SystemErr     R (Location of error unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-row is missing child elements. Required Content Model: (table-cell+)

The weird thing is that this error only happens at first time or first few times, then the PDF file generation goes fine. Then if user browses other pages and comes back, this can happen again. This error is not consistent, sometimes everything is just fine. This is really frustrating and hard to debug. 

This never happened in my unit test and local environment. So I am thinking it might be the cache issue or web server configuration issue. But I have no clue. This is tough one.

Any suggestions or solutions?

Thanks.

Zemin

----------------------------------------------------------------------
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

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


RE: XSL caching question

Posted by SG...@CERNER.COM.
Tamu,
Based simply on the code sample that Brian provided in his original post over a year ago, the XSL will only be "compiled" when the class containing that static initializer is loaded.  That class won't be loaded until it's used, so your first run is always going to include both compilation and transformation time while subsequent runs will just include transformation.  Couple that with the fact that even after compilation there is undoubtedly other caching and potential class loading going on by both the JVM and OS when you do the first transformation.  And finally, Brian's original post coupled the XSLT transformation with the FOP rendering; these are separate processes and FOP does not control how you use the XSLT to get to the XSL-FO it needs.

Assuming your code is like Brian's, it's doing what it's supposed to do (though I personally don't like static initializers myself because of the exception-eating that goes on if there's an error in the stylesheet that causes it to not compile).  If you want to perform the stylesheet compilation before the first run you need to put it in a method that gets called from the lifecycle hooks in your application.  Assuming this is in a web application, you can do it in the ServletContextListener.contextInitialized method.

Sean

-----Original Message-----
From: tamugrg [mailto:sagun.gurung@auspost.com.au] 
Sent: Friday, January 22, 2010 6:34 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: XSL caching question


Hi,

I am facing exactly the same issue. The first time the XSL gets used, it
takes quite a bit of time to do the transformation. After that the
transformations happen much faster. I am using templates as described in
this thread & assume the style sheet should be cached. But from the
behaviour that it takes longer the first time the XSLs are being used &
subsequently takes lesser time indicates that probably it's not been
catched.

Any suggestions/experience on this is very much appreciated.

Cheers,
tamu



Brian Trezise wrote:
> 
> Silly me, going to be hard for you guys to answer my question if you don't
> have a code sample to look at J
> 
> 
> 
> 
>    static
> 
>    {
> 
>       try
> 
>       {
> 
>          cyberTron = TransformerFactory.newInstance();
> 
>          Config config = (Config)
> ConfigManager.getInstance().getConfig(Config.class);
> 
>          Source xslt = new StreamSource(new
> File(config.getXSLTemplateURL()));
> 
>          allSpark = cyberTron.newTemplates(xslt);
> 
>       }
> 
>       catch(Exception e)
> 
>       {
> 
>          logger.error(e);
> 
>       }
> 
>    }
> 
>  
> 
> ~Brian
> 
> ___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> 22288 E Princeton Dr
> aurora, colorado 80018
> T: 720.524.4864
> brian.trezise@intellidata.net
> 
>  
> 
> From: Brian Trezise [mailto:Brian.Trezise@IntelliData.net] 
> Sent: Monday, August 25, 2008 2:41 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: XSL caching question
> 
>  
> 
> In FOP 0.95, I'm using the basic caching method to cache my XSL
> transformation file, not doing anything fancy with file system monitors or
> anything for the time being.  The first time I run FOP on the server to
> generate a pdf, it takes 10-20 seconds to generate the pdf because it's
> loading up the XSL file for the first run.  Afterwards it runs in the
> neighborhood of 500ms per PDF.  I was just wondering if there is a way to
> force the XSL to fully cache statically?
> 
> This isn't a huge issue as we don't restart our servers all that often but
> it's just a little thing that's bugging me J
> 
> Thanks,
> 
> ___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> 22288 E Princeton Dr
> aurora, colorado 80018
> T: 720.524.4864
> brian.trezise@intellidata.net
> 
>  
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/XSL-caching-question-tp19151328p27272536.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

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


RE: XSL caching question

Posted by tamugrg <sa...@auspost.com.au>.
Hi,

I am facing exactly the same issue. The first time the XSL gets used, it
takes quite a bit of time to do the transformation. After that the
transformations happen much faster. I am using templates as described in
this thread & assume the style sheet should be cached. But from the
behaviour that it takes longer the first time the XSLs are being used &
subsequently takes lesser time indicates that probably it's not been
catched.

Any suggestions/experience on this is very much appreciated.

Cheers,
tamu



Brian Trezise wrote:
> 
> Silly me, going to be hard for you guys to answer my question if you don't
> have a code sample to look at J
> 
> 
> 
> 
>    static
> 
>    {
> 
>       try
> 
>       {
> 
>          cyberTron = TransformerFactory.newInstance();
> 
>          Config config = (Config)
> ConfigManager.getInstance().getConfig(Config.class);
> 
>          Source xslt = new StreamSource(new
> File(config.getXSLTemplateURL()));
> 
>          allSpark = cyberTron.newTemplates(xslt);
> 
>       }
> 
>       catch(Exception e)
> 
>       {
> 
>          logger.error(e);
> 
>       }
> 
>    }
> 
>  
> 
> ~Brian
> 
> ___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> 22288 E Princeton Dr
> aurora, colorado 80018
> T: 720.524.4864
> brian.trezise@intellidata.net
> 
>  
> 
> From: Brian Trezise [mailto:Brian.Trezise@IntelliData.net] 
> Sent: Monday, August 25, 2008 2:41 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: XSL caching question
> 
>  
> 
> In FOP 0.95, I'm using the basic caching method to cache my XSL
> transformation file, not doing anything fancy with file system monitors or
> anything for the time being.  The first time I run FOP on the server to
> generate a pdf, it takes 10-20 seconds to generate the pdf because it's
> loading up the XSL file for the first run.  Afterwards it runs in the
> neighborhood of 500ms per PDF.  I was just wondering if there is a way to
> force the XSL to fully cache statically?
> 
> This isn't a huge issue as we don't restart our servers all that often but
> it's just a little thing that's bugging me J
> 
> Thanks,
> 
> ___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> 22288 E Princeton Dr
> aurora, colorado 80018
> T: 720.524.4864
> brian.trezise@intellidata.net
> 
>  
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/XSL-caching-question-tp19151328p27272536.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: XSL caching question

Posted by Brian Trezise <Br...@IntelliData.net>.
Silly me, going to be hard for you guys to answer my question if you don't
have a code sample to look at J




   static

   {

      try

      {

         cyberTron = TransformerFactory.newInstance();

         Config config = (Config)
ConfigManager.getInstance().getConfig(Config.class);

         Source xslt = new StreamSource(new
File(config.getXSLTemplateURL()));

         allSpark = cyberTron.newTemplates(xslt);

      }

      catch(Exception e)

      {

         logger.error(e);

      }

   }

 

~Brian

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
22288 E Princeton Dr
aurora, colorado 80018
T: 720.524.4864
brian.trezise@intellidata.net

 

From: Brian Trezise [mailto:Brian.Trezise@IntelliData.net] 
Sent: Monday, August 25, 2008 2:41 PM
To: fop-users@xmlgraphics.apache.org
Subject: XSL caching question

 

In FOP 0.95, I'm using the basic caching method to cache my XSL
transformation file, not doing anything fancy with file system monitors or
anything for the time being.  The first time I run FOP on the server to
generate a pdf, it takes 10-20 seconds to generate the pdf because it's
loading up the XSL file for the first run.  Afterwards it runs in the
neighborhood of 500ms per PDF.  I was just wondering if there is a way to
force the XSL to fully cache statically?

This isn't a huge issue as we don't restart our servers all that often but
it's just a little thing that's bugging me J

Thanks,

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
22288 E Princeton Dr
aurora, colorado 80018
T: 720.524.4864
brian.trezise@intellidata.net

 


Re: XSL caching question

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
As far as I can tell, you're already doing what's possible. Creating a
"Templates" object is the JAXP way of caching the stylesheet. The only
other thing you can try is to compile a stylesheet using Xalan's XSLTC
to Java which might or might not bring additional performance. I've
never measured the benefit myself.

http://xml.apache.org/xalan-j/xsltc_usage.html

Please note that the first run takes so long because you have various
tasks that are performed once then:
- Class loading
- Just-in-time compiling (JIT) of Java byte code
- Stylesheet loading

That it takes up to 20 seconds the first time sounds a little excessive
but I don't know what your application and hardware looks like.

It might make sense if you ran a profile to see where exactly so much
time is used.

On 25.08.2008 22:41:14 Brian Trezise wrote:
> In FOP 0.95, I'm using the basic caching method to cache my XSL
> transformation file, not doing anything fancy with file system monitors or
> anything for the time being.  The first time I run FOP on the server to
> generate a pdf, it takes 10-20 seconds to generate the pdf because it's
> loading up the XSL file for the first run.  Afterwards it runs in the
> neighborhood of 500ms per PDF.  I was just wondering if there is a way to
> force the XSL to fully cache statically?
> 
> This isn't a huge issue as we don't restart our servers all that often but
> it's just a little thing that's bugging me J
> 
> Thanks,
> 
> ___________________________________________________
> Brian Trezise
> Staff Software Engineer
> IntelliData, Inc
> 22288 E Princeton Dr
> aurora, colorado 80018
> T: 720.524.4864
> brian.trezise@intellidata.net
> 
>  
> 




Jeremias Maerki


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