This page describes how to use Apache FOP to work within the JBoss application server. JBoss's use of commons-logging and Log4J for its internal server logging can cause a FOP exception due to logging jar file classloading clashes. This page will explain how to get Apache FOP and JBoss AS to both work using commons-logging, but different underlying logging implementations.

Please note that this is for FOP 0.91 or greater only.

Get the Apache FOP jars

You can download them at: http://www.apache.org/dyn/closer.cgi/xmlgraphics/fop

Setup instructions

<snip/>

REM First set up the new APPJARS variable to include all necessary application jars
set APPJARS=
set APPJARS=%APPJARS%;\prod_jars_091_14\avalon-framework-4.2.0.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\batik-all-1.6.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\commons-io-1.1.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\commons-logging-1.0.4.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\serializer-2.7.0.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\xalan-2.7.0.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\xercesImpl-2.7.1.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\xml-apis-1.3.02.jar
set APPJARS=%APPJARS%;\prod_jars_091_14\fop.jar

REM Now add JBoss's included log4j jar 
set APPJARS=%APPJARS%;\jboss403SP1\lib\log4j-boot.jar

<snip/>

REM Now add our new APPJARS variable to the JBOSS_CLASSPATH
if "%JBOSS_CLASSPATH%" == "" (
        set JBOSS_CLASSPATH=%APPJARS%;%APPJARSPOST%;%JAVAC_JAR%;%RUNJAR%
) ELSE (
        set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%APPJARS%;%APPJARSPOST%;%JAVAC_JAR%;%RUNJAR%

<snip/>

Follow the same procedure for the shell script (just use scripting language instead).

Notes

HowTo/JBossAS (last edited 2009-09-20 23:52:46 by localhost)