1. Copy xmlparserv2.jar from my ORACLE_HOME/oc4j/lib directory to my glassfish domains/domain1/applications/fop/WEB-INF/lib directory.
2. Added the following two lines to the glassfish domains/domain1/fop/apex_fop.jsp before the driver.run() line