xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Niedermann <...@thelogic.org>
Subject Unable to catch transformer Exception
Date Mon, 16 Mar 2009 13:16:10 GMT

Hi,

I get a planned Exception while invoking transformer.transform.
Unfortunately I can not catch this Exception. This is the code:

	    try {
	        // construct fop with desired output format
	        Fop fop = fopFactory.newFop(type, foUserAgent, out);
	
	        // setup XSLT
	        TransformerFactory factory = TransformerFactory.newInstance();
	        Transformer transformer = factory.newTransformer(new
StreamSource(xsltfile));
	
	        // setup input for XSLT transformation
	        Source src = new DOMSource(dom);
	
	        // resulting SAX events (the generated FO) must be piped through to
FOP
	        Result res = new SAXResult(fop.getDefaultHandler());
	
	        // start XSLT transformation and FOP processing
	        transformer.transform(src, res);
	    } catch (Exception e) {
	    	System.err.println("ERROR: " + e.getMessage());
	    } finally {
	        out.close();
	    }

Altough transformer.transform() has an Exception, I never get the System.err
message. Instead I only get the ERROR-message from log4j (see below). I need
to catch the Exception in order to react with my program. Am I missing
something here?

Thanks,
  Frank

This is the console output:
2009-03-16 14:10:42,580 ERROR [org.apache.fop.render] Some XML content will
be ignored. Could not render XML
java.lang.NullPointerException: Parameter msg must not be empty
	at
org.krysalis.barcode4j.impl.code39.Code39Bean.generateBarcode(Code39Bean.java:187)
	at
org.krysalis.barcode4j.impl.ConfigurableBarcodeGenerator.generateBarcode(ConfigurableBarcodeGenerator.java:161)
	at
org.krysalis.barcode4j.fop.BarcodeXMLHandler.convertToSVG(BarcodeXMLHandler.java:222)
	at
org.krysalis.barcode4j.fop.BarcodeXMLHandler.handleXML(BarcodeXMLHandler.java:115)
	at
org.apache.fop.render.AbstractRenderer.renderXML(AbstractRenderer.java:808)
	at
org.apache.fop.render.PrintRenderer.renderDocument(PrintRenderer.java:169)
	at
org.apache.fop.render.AbstractPathOrientedRenderer.renderForeignObject(AbstractPathOrientedRenderer.java:781)
	at
org.apache.fop.render.AbstractRenderer.renderViewport(AbstractRenderer.java:747)
	at
org.apache.fop.render.AbstractPathOrientedRenderer.renderViewport(AbstractPathOrientedRenderer.java:621)
	at
org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:626)
	at
org.apache.fop.render.pdf.PDFRenderer.renderInlineArea(PDFRenderer.java:1345)
	at
org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:601)
	at
org.apache.fop.render.pdf.PDFRenderer.renderLineArea(PDFRenderer.java:1336)
	at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:536)
	at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:573)
	at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:1329)
	at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:526)
	at
org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:548)
	at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:560)
	at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:1329)
	at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:526)
	at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:573)
	at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:1329)
	at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:526)
	at
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:573)
	at org.apache.fop.render.pdf.PDFRenderer.renderBlock(PDFRenderer.java:1329)
	at
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:526)
	at
org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:424)
	at
org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:577)
	at
org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:403)
	at
org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:337)
	at
org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:282)
	at
org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:255)
	at
org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:229)
	at org.apache.fop.render.pdf.PDFRenderer.renderPage(PDFRenderer.java:801)
	at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:113)
	at
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312)
	at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167)
	at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:108)
	at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
	at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
	at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
	at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
	at
org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:261)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1399)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1374)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
	at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
	at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java: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)
	at com.ifm.Kanban.CreateOutput.createOutput(CreateOutput.java:59)
	at com.ifm.Kanban.Kanban.main(Kanban.java:217)
-- 
View this message in context: http://www.nabble.com/Unable-to-catch-transformer-Exception-tp22537909p22537909.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


Mime
View raw message