Share the content if you found it is useful (You can share using 300 community websites) click "share" at the end of the post.

You are encouraged to leave a comment.

Wednesday, September 30, 2009

Configuring Apache FOP for Apex 3.2 PDF Printing

This blog is about Configuring the Apex PDF printing with Apache FOP.

You need to download the OC4J from here
You move the downloaded file to the server where you want to configure. I installed it in the application server where i integrated the Apex with Oracle EBS. (Linux Box)

To integrate the Apex with Oracle EBS (11i/R12) please refer my blog entry

The server used:
Ports used for Apex: 7778 (Application Server)
OC4J: 8888 (OC4J Instance created with the zip file downloaded)

1. Create a directory called oc4j (it is under /oracle/oc4j)
2. Move the downloaded file to the /oracle/OC4j and extract the content using unzip
3. Read the Readme.txt from the extracted file to start the oc4j
4. Prerequisite for the OC4j will be
In order to use the OC4J zip distribution, a Java Platform StandardEdition (Java SE) Development Kit version 6.0, 5.0 (or 1.4.2) must be installed on the host machine.
in my case i chose /usr/java/j2sdk1.4.2_04
Instructions for configuring the OC4J instance:
1. Setup the JAVA_HOME and ORACLE_HOME as
export $ORACLE_HOME=/oracle/OC4j
export $JAVA_HOME=/usr/java/j2sdk1.4.2_04

2. Start the OC4J like (from the server screen itself, Donot use putty or anyother terminal to start oc4j, as it requires the studio to be deployed in the server)
./oc4j -start (from /oracle/OC4j/bin/)
During the startup it will ask you the password for oc4jadmin (In my case it is welcome) confirm the password and it will be initialized)
3. From the browser type http://hostname:8888/
should bring the oc4j webpage.
From the home, select
launch Appliction Server Control
the url will be like http://hostname:8888/em
provide the oc4jadmin password to enter into the ASCONTROL
4. Installing the FOP War:
Place the fop.war file (located in apex_install_directory/utlities/fop) in an accessible location on your local machine.

Navigate to your OC4J Oracle Enterprise Manager Console eg: http://localhost:8888/em/
Select the Applications Tab
Select Deploy Button

Transfer the fop.war from apex/utilities from the apex server to your local machine where you are trying to activate the war through a browser

On the "Deploy: Select Archive" page
use the option "Archive is present on local host. Upload the archive to the server where Application Server Control is running."
Use the file browse to select the fop.war file and click "Next" button

On the "Deploy: Application Attributes" page
Set the "Application Name" option to "fop" and
Clear the "Context Root " option and click "Next" Button

On the Deploy: Deployment Settings click the "Deploy" button

From the home > applications, you can see now, fop is up and running.

Now login to the apex using the url : http://genius:7778/pls/apex_r12/apex_admin
provide the password for administrator and get into the screen as below:

Select the Instance settings from manage services menu as below.

Now configure the printer configuration as below:

Oracle BI Publisher: Standard Support
Print Server Protocol: HTTP or HTTPS (depends on your configuration)
Print Server Host Address: the hostname for the machine where the java container is running - i gave the IP of the server
Print Server Port: the port that the OC4J is listening on - e.g. 8888
Print Server Script: /fop/apex_fop.jsp

Apply the changes and login to the Workspace and developer user. Locate the report to be taken in PDF format.

From the Print Attributes page, pass the values as mentioned in the screen shot:

Apply the changes and click on the report you need to run.

You can see the name of the print label you passed earlier on the report to be taken as PDF. See the image below. Circled with red pen.

Configuration of the Apex with PDF has been finished. When we are running a long report, we get
500 Internal error:
Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
At the same time, when we look into the log from /OC4J HOME/j2ee/home/application-deployments/fop/fop/application.log, we found:
09/09/30 11:56:27.82 fop: Servlet errorjava.lang.OutOfMemoryError
09/09/30 12:00:13.251 fop: Servlet errorjava.lang.OutOfMemoryError
09/09/30 12:00:20.440 fop: Servlet errorjava.lang.OutOfMemoryError
09/09/30 12:19:05.928 fop: Servlet errorjava.lang.OutOfMemoryError
09/09/30 12:19:16.716 fop: Servlet errorjava.lang.OutOfMemoryError
According the Metalink ID: 744866.1, we did the Memory adjustment, still we are getting the error when we run the large reports.
Will post if any permenent fix for this.


Shivani said...

Great Yaar ....Its working fine.

Anonymous said...


if you do not have a OC4J server look at this, it is a free fop server perfect as starting point: said...

every thing configured correctly,

but pdf not opening

it shows 500 error internal server error

Related Posts Plugin for WordPress, Blogger...

Let us be Friends...

Share |

Popular Posts


11.5.1. to 11.5.5 Cloning Procedure. 11g 11i 11i and R12 11i Autoconfig 11i Cloning 12.1.1 SSL 2 Node RAC errors out adop Advanced Replication Apache version Apex Apex for Oracle database Apex Installation Apex Installation on Oracle E Business Suite. 11i with Apex Apex on 11i Apex on Oracle 11i Apex402 apexins.sql APPL_TOP Character Application Express Application server Issue APPLSYS password Apps Password Asynchronous Replication Autoconfig Autoconfig Managed Beehive Bit of operating system Block block media corrupt BPEL Central Inventory Character Set Conversion Cloning of 11i Cloning of Oracle Applications Clusterware Concurrent CPU 2011 CPU 2012 April CPU 2012 January. CPU 2012 October CRS custom top Custom Top Creation Database . Database Query Dataguard DBMS_REPAIR Demantra . Domain Name E Business Suite Migration EBS 12.2 EPM exp/imp Oracle Applications Flashback table flows_020200 FND_TOP/resource FNDCPASS FNDCPUCF Forms server upgrade Forms startup FRM-92101 Fusion Middleware Hostname Hot Backup Hot cloning HotBackup Hotbackup Cloning of Oracle Apps hrglobal.drv. NLS Saudi Arabian HRMS hyperion Import and Export Oracle Applications Install Oracle Installation of R12 Installation Steps integration Oracle EBS Issues Database issues Oracle EBS Issues with Upgrade 12.1.1 Java Mission Control Java Upgrade java/sql/SavePoint JInitiator Junk Characters Language Translation Linux Linux Migration listener trace Listner version Local Inventory Login Page Master-Master Replication Memory Tuning Multiple Language NLS Non-Autoconfig Enabled OBIEE 11g Installation OBIEE Issues OIM Opatch version OpenSSL ora-01031 Oracle oracle 11g Oracle Announcement Oracle Application servers Oracle Application services Oracle Applications Oracle Applications 11i oracle applications 12.2 Oracle Applications Cloning Oracle Applications Upgrade Oracle Applications. Oracle Apps cloning Oracle BPEL oracle certifications oracle database Oracle Database RMAN Oracle Database upgradation Oracle DB oracle E Business suite 12.2 Oracle EBS oracle EPM Oracle Forms Logo oracle Fusion Applications Oracle Inventory oracle news Oracle OUI Oracle R12 oracle Sun Solaris Oracle Tuning Oracle Virtual Box Oracle Webgate Oracle WMA configuration orcladmin password for Oracle Applications Pasta Configuration pasta.cfg patch PDF Performance Physical Standby Platform migration Printer Configuration Profile Option R12 RAC Rapid Install Rapidwiz Real Application Clusters 10g Recovery RMAN RMAN Recovery SA Gosi Service Oriented Architecture SOA SQLTXPLAIN SSL Configuration step-by-step upgrade Sun solaris Swap Tablespace Trace Enable Trace file Translation Synchronization Patch transport tablespace tuning Tuning SGA uifont.ali Underscore Universal Content Management Upgradation of 12.0.5 to 12.1.1 Upgrade Upgrade 11g Upgrade Apps Upgrade DB Upgrade to 11g UTF8 version of oracle applications versions Web server upgrade weblogic windows workflow version XML Publisher version