xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil Pinto" <api...@lobotec.com>
Subject FW: How to trap a Barcode4J exception from Java prgram running embedded FOP
Date Mon, 18 May 2009 06:20:38 GMT
Anybody, has any information that can help with this ? Is there any error
listener that I can register with FOP to be able to catch these errors ?


-----Original Message-----
From: Anil Pinto [mailto:apinto@lobotec.com]
Sent: Wednesday, May 13, 2009 12:20 PM
To: FOP Mailing List
Subject: How to trap a Barcode4J exception from Java prgram running embedded
FOP


Hi,

We have been running FOP from within a Java application that
programmatically applies the XSL and XML to create PDFs.

We have also incorporated references to the Barcode4J program to be able to
embed barcodes in the PDF.

Recently we encountered an error in the FOP process and expected the
"exception" to be caught by the surrounding exception handling code, but it
did not. Under most circumstances any errors thrown by the FOP process are
caught, but for the following error, the exception trace is shown (I think
internally) but is not available to be caught and handled. The subsequent
exception that happens due to this initial exception is then caught by the
try catch block.

Could someone from the FOP/Barcode4J team please throw some light on this
situation ?


=============== This exception is not caught but the trace is printed on the
console ============================================

java.lang.IllegalArgumentException: Unable to fit message in columns
 at
org.krysalis.barcode4j.impl.pdf417.PDF417LogicImpl.generateBarcodeLogic(PDF4
17LogicImpl.java:199)
 at
org.krysalis.barcode4j.impl.pdf417.PDF417Bean.generateBarcode(PDF417Bean.jav
a:79)
 at
org.krysalis.barcode4j.impl.ConfigurableBarcodeGenerator.generateBarcode(Con
figurableBarcodeGenerator.java:161)
 at org.krysalis.barcode4j.xalan.BarcodeExt.generate(BarcodeExt.java:69)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at
org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(Extension
HandlerJavaClass.java:399)
 at
org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(Extension
HandlerJavaClass.java:438)
 at
org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java
:220)
 at
org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.jav
a:473)
 at
org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:206)
 at org.apache.xpath.XPath.execute(XPath.java:335)
 at org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:132)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
1374)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
1374)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
1374)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
1374)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
1374)
 at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApp
lyTemplates.java:393)
 at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:176)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
1374)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2411)
 at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2281)
 at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1367)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
709)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1284)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1262)


======================== The following exception is caught by the Try {}
catch (Exception e) {} ===============================================

javax.xml.transform.TransformerException: org.xml.sax.SAXException:
Mismatch: instream-foreign-object (http://www.w3.org/1999/XSL/Format) vs.
root (http://www.w3.org/1999/XSL/Format)
 at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
725)
 at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2339)
 at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2160)
 at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1213)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
668)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1129)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1107)


Thanks,
Anil Pinto.

Lobo Technologies, Inc.
16980 Via Tazon, Suite 120, San Diego, CA 92127
Voice : 858-485-9033 x 103
Fax   : 858-485-9152

Mime
View raw message