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 lifeleaf <mi...@cibc.com> on 2006/08/15 22:52:23 UTC

PDF generation fails sometimes

I am using 0.92beta, using xslt to PDF.


Most of time the generation works fine, but sometimes it throw exception as
following, it seems some class is not thread safe:

; SystemID:
file:///usr/bea/home/beadtp4/config/dp4/tecp/config/conf/fop/fax-mail.xsl;
Line#: 66; Column#: 93
javax.xml.transform.TransformerException:
java.lang.IllegalArgumentException: The number of this PDFNumber must not be
empty
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2344)
        at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
        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)
        at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
        at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)


The line reported wrong in xsl is :
			<fo:page-sequence master-reference="Section1-ps" >


The code is complicate and confidential, so sorry I can not attach here, but
this seems strange, i need some idea how can this happen sometime and not
always...

Thanks
Michael 
     
-- 
View this message in context: http://www.nabble.com/PDF-generation-fails-sometimes-tf2111448.html#a5821775
Sent from the FOP - Users forum 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: PDF generation fails sometimes

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 17, 2006, at 22:34, Jeremias Maerki wrote:

Hi,

> Uh, sorry, I somehow missed your hint about "not thread safe". I  
> thought
> it was something simpler. Your additional details seem to confirm that
> it's about thread-safety.

Seems like the real clue is this:

>> 3, if I close the open-window quite fast(may before the PDF files are
>> actually generated), and start all 3 again, it will happen 1 of  
>> 10-40 times.
>> Althougn this is quite seldom, but still is not acceptable for my  
>> situation.

Looking at the code, it seems perfectly possible that, if a rendering  
is interrupted, a PDFNumber is instantiated, but setNumber() is never  
called for it.

Question remains: does the error arise in the thread following the  
interrupted one, or in the interrupted thread itself, as a side- 
effect of the renderer trying to output a PDFNumber that has been  
instantiated?

PDFNumber does have a private static member storing the decimal  
format. Maybe this is the bugger here?

Cheers,

Andreas


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


Re: PDF generation fails sometimes

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Uh, sorry, I somehow missed your hint about "not thread safe". I thought
it was something simpler. Your additional details seem to confirm that
it's about thread-safety. Could you get the whole stack trace for us?
The problem is that the part you showed is not the right one. There's a
nested exception that is missing (the part with the org.apache.fop.*
entries). Maybe with the full stack trace we get some hint about where
to start looking for the problem.

On 17.08.2006 22:24:17 lifeleaf wrote:
> 
> Hi,
> Sorry I cant put my code here, it involves 10+ java code, and a 400+ lines
> xslt, plus lots .jar files.
> I hope I can get some hint for this problem. Debug probably will not help me
> since this is not happen always, debug means process code slowly and that
> probably will not generate a err then.
> 
> I can provide more details about this:
> 1. I use IE activex (<object classid='.....') to get the pdf, and I have 2
> of this in iframe, 1 in an open window at same time.
> 2. If I do this quite slow, the error will not happen
> 3, if I close the open-window quite fast(may before the PDF files are
> actually generated), and start all 3 again, it will happen 1 of 10-40 times.
> Althougn this is quite seldom, but still is not acceptable for my situation.
> 
> Thanks in advance
> Michael 
> 
> 
> 
> Jeremias Maerki-2 wrote:
> > 
> > There's no way we can assist you without an actual FO that causes this
> > exception. So, you'll have to produce an FO file from one of your
> > documents you know causes the error and you'll have to try to anonymize
> > the FO file without losing the ability to reproduce the exception if the
> > content is problematic. Otherwise, you'll simply have to set up FOP for
> > debugging and find the bug yourself.
> > 
> > On 15.08.2006 22:52:23 lifeleaf wrote:
> >> 
> >> I am using 0.92beta, using xslt to PDF.
> >> 
> >> 
> >> Most of time the generation works fine, but sometimes it throw exception
> >> as
> >> following, it seems some class is not thread safe:
> >> 
> >> ; SystemID:
> >> file:///usr/bea/home/beadtp4/config/dp4/tecp/config/conf/fop/fax-mail.xsl;
> >> Line#: 66; Column#: 93
> >> javax.xml.transform.TransformerException:
> >> java.lang.IllegalArgumentException: The number of this PDFNumber must not
> >> be
> >> empty
> >>         at
> >> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2344)
> >>         at
> >> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
> >>         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)
> >>         at
> >> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
> >>         at
> >> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
> >> 
> >> 
> >> The line reported wrong in xsl is :
> >> 			<fo:page-sequence master-reference="Section1-ps" >
> >> 
> >> 
> >> The code is complicate and confidential, so sorry I can not attach here,
> >> but
> >> this seems strange, i need some idea how can this happen sometime and not
> >> always...


Jeremias Maerki


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


Re: PDF generation fails sometimes

Posted by lifeleaf <mi...@cibc.com>.
Hi,
Sorry I cant put my code here, it involves 10+ java code, and a 400+ lines
xslt, plus lots .jar files.
I hope I can get some hint for this problem. Debug probably will not help me
since this is not happen always, debug means process code slowly and that
probably will not generate a err then.

I can provide more details about this:
1. I use IE activex (<object classid='.....') to get the pdf, and I have 2
of this in iframe, 1 in an open window at same time.
2. If I do this quite slow, the error will not happen
3, if I close the open-window quite fast(may before the PDF files are
actually generated), and start all 3 again, it will happen 1 of 10-40 times.
Althougn this is quite seldom, but still is not acceptable for my situation.

Thanks in advance
Michael 



Jeremias Maerki-2 wrote:
> 
> There's no way we can assist you without an actual FO that causes this
> exception. So, you'll have to produce an FO file from one of your
> documents you know causes the error and you'll have to try to anonymize
> the FO file without losing the ability to reproduce the exception if the
> content is problematic. Otherwise, you'll simply have to set up FOP for
> debugging and find the bug yourself.
> 
> On 15.08.2006 22:52:23 lifeleaf wrote:
>> 
>> I am using 0.92beta, using xslt to PDF.
>> 
>> 
>> Most of time the generation works fine, but sometimes it throw exception
>> as
>> following, it seems some class is not thread safe:
>> 
>> ; SystemID:
>> file:///usr/bea/home/beadtp4/config/dp4/tecp/config/conf/fop/fax-mail.xsl;
>> Line#: 66; Column#: 93
>> javax.xml.transform.TransformerException:
>> java.lang.IllegalArgumentException: The number of this PDFNumber must not
>> be
>> empty
>>         at
>> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2344)
>>         at
>> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
>>         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)
>>         at
>> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
>>         at
>> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
>> 
>> 
>> The line reported wrong in xsl is :
>> 			<fo:page-sequence master-reference="Section1-ps" >
>> 
>> 
>> The code is complicate and confidential, so sorry I can not attach here,
>> but
>> this seems strange, i need some idea how can this happen sometime and not
>> always...
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/PDF-generation-fails-sometimes-tf2111448.html#a5858920
Sent from the FOP - Users forum 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: PDF generation fails sometimes

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
There's no way we can assist you without an actual FO that causes this
exception. So, you'll have to produce an FO file from one of your
documents you know causes the error and you'll have to try to anonymize
the FO file without losing the ability to reproduce the exception if the
content is problematic. Otherwise, you'll simply have to set up FOP for
debugging and find the bug yourself.

On 15.08.2006 22:52:23 lifeleaf wrote:
> 
> I am using 0.92beta, using xslt to PDF.
> 
> 
> Most of time the generation works fine, but sometimes it throw exception as
> following, it seems some class is not thread safe:
> 
> ; SystemID:
> file:///usr/bea/home/beadtp4/config/dp4/tecp/config/conf/fop/fax-mail.xsl;
> Line#: 66; Column#: 93
> javax.xml.transform.TransformerException:
> java.lang.IllegalArgumentException: The number of this PDFNumber must not be
> empty
>         at
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2344)
>         at
> org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:710)
>         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)
>         at
> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
>         at
> org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
> 
> 
> The line reported wrong in xsl is :
> 			<fo:page-sequence master-reference="Section1-ps" >
> 
> 
> The code is complicate and confidential, so sorry I can not attach here, but
> this seems strange, i need some idea how can this happen sometime and not
> always...


Jeremias Maerki


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