On 16 Mar 2009, at 14:16, Frank Niedermann wrote:

Hi

I get a planned Exception while invoking transformer.transform.
Unfortunately I can not catch this Exception. This is the code:
<snip />
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?
<snip />
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

The stack trace indicates that the error is non-fatal, so no matter what, it will not trigger the fatalError() handler which would normally cause the Exception to be thrown.

As of FOP Trunk, reacting on that error should be possible (if it is properly routed through the event-handling framework; see: http://xmlgraphics.apache.org/fop/trunk/events.html) . For FOP 0.95, I don't think it is possible to 'catch' the Exception, since it is never thrown. The Barcode4J extension causes an Exception, but FOP internally catches this and recovers. Unless you feel like working with a hacked FOP-version, or you can switch to FOP Trunk, I'm afraid you're stuck... :-/


Regards

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to