Tuesday, February 05, 2008

Flying Saucer renderer in JBoss Seam Fix

Used the iText and The Flying Saucer xhtml renderer to generate pdf's in my JBoss Seam application.

Problem: Everything worked fine. A pdf was generated in my app but the application context was somehow corrupt after the pdf generation and I could not continue using the app unless I redeployed it on JBoss AS again. I noticed that this happened after I had instanciated the org.xhtmlrenderer.pdf.ITextRenderer.

Found the fix for this in the JBoss Seam forum (thanks Calvin, you saved my day :)).

------------------------------------------------------------------------
Here's a fix for the problem. Set this system property before instantiating your first instance of ITextRenderer:
Code:
System.setProperty("xr.util-logging.loggingEnabled", "false"); 

The problem seems to be caused by Flying Saucer reconfiguring the log manager by calling LogManager.readConfiguration. Flying Saucer shouldn't really be doing this because it blows away any existing log configuration, but on the other hand it's odd that Seam (or maybe JBoss?) behaves this way when logging is reconfigured.
--Calvin
----------------------------------------------------------------------------
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106412#4106412

No comments: