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.








Showing posts with label Apex. Show all posts
Showing posts with label Apex. Show all posts

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 http://balajiabhi.blogspot.com/search?q=apex

The server used: genius.chainsys.com
IP: 192.168.2.207
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
Prerequisites
--------------
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.
Cheers!!!

Thursday, March 12, 2009

Integrating Apex 3.2 with R12 (With Oracle Application Server 10g on the other Machine)

Today, I need to blog out my experience with Apex integration with R12 E Business Suite!!!

How I did: as follows.

As you know how to install Oracle Application Server 10.1.2.0 (Database 10.1.0.4)

1. Download Application Server 10g from OTN
2. Unzip the content. It will create 4 Disks (Disk1, Disk2, Disk3 and Disk4)

3. From Disk1 run
$./runInstaller

This will bring up the welcome screen. Select the Oracle home and other requisites. Later,
Select to Oracle Application Server Infrastructure 10g (10.1.2.0.2)


It will create one new database, (10g, Version 10.1.0.4) and New OID, Oracle Application server single-sing on, metadata repository and others. (I will detailedly explain how we can configure Application server in a separate blog)

Finish the installation. This will bring you basic HTTP server (OHS managed by OPMN)

This is what we want right at the moment.

Write a profile for database as follows.
export ORACLE_HOME=/oracle/ASHOME/
export ORACLE_SID=apex
export PATH=$PATH:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_TERM=xterm
export ORACLE_OWNER=oracle
export TNS_ADMIN=$ORACLE_HOME/network/admin
export CLASSPATH=$ORACLE_HOME/jdbc/lib/classes12.zip
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export LDPATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32

So my ORACLE_HOME is /oracle/ASHOME

Now the Application server is ready for operation. Check the Application server page correctly displays using
http://hostname:port (here my port no is 7778 ie. Apache Port from Application Server 10g)

Now, Apex Installation. Download apex_3.2.zip from here
Unzip the apex_3.2.zip into a separate direcory. It will create a folder called apex. My location is /oracle/apex

4. Connect as sys user.
5. Create a tablespace for apex. i created apex32 with datafile apex32
6. Run apexins.sql

SQL>@apexins.sql apex32 apex32 temp /i/
where apex32 is the tablespace name
where apex32 is the datafile name
temp is the temporary tablespace
/i/ is the location of the image folder to be given in the configuration file. (simply give /i/)

Successful installation will have the following content at the end.

Thank you for installing Oracle Application Express. Oracle Application Express is installed in the FLOWS_030200 schema.

The structure of the link to the Application
Express administration services is as follows: http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql) http://host:port/apex/apex_admin (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)

The structure of the link to the Application Express development interface is as follows: http://host:port/pls/apex (Oracle HTTP Server with mod_plsql)
http://host:port/apex (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)

Installation logfile will be located under /oracle/apex as installYYYY-MM-DD_HH24-MI-SS.log.

7. Change Password for ADMIN Account
- Change directory to apex
- Connect to DB as sys user and execute
- @apxchpwd

Configure HTTP Server
1. Unlock the APEX_PUBLIC_USER account
alter user APEX_PUBLIC_USER account unlock

alter user APEX_PUBLIC_USER identified by (new password)


2. Copy APEX Images
- Copy /oracle/apex/images to /oracle/ASHOME/Apache/Apache/images/ .
This is the /i/ location where we installed our images.
$cp -rf /oracle/apex/images /oracle/ASHOME/Apache/Apache/images

Adding DAD entry in dads.conf file (in /oracle/ASHOME/Apache/modplsql/conf/)

Alias /i/ “[ Put the IMAGE_LOC Value] “ as /oracle/ASHOME/Apache/Apache/images
AddType text/xml xbl
AddType text/x-component htc

<Location /pls/apex>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString hostname:port:SID (here my entry is genius:1521:apex (MY SID Name is apex)

PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex

PlsqlDatabasePassword APEX_PASSWORD (here my entry is welcome)
PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
Allow from all

</Location>

Bounce the Apache Server as
/oracle/ASHOME/opmn/bin/opmnctl stopproc ias-component=HTTP_server

or if you want to stopall, then give ./opmnctl stopall. to bounce all the services.

Now Check with
http://hostname:port:/pls/apex/apex_admin (should bring you the welcome page of the Apex with images. Here my port is 7778 as installed in Application Server 10g OHS server)
if images are not coming, then further navigation is not possible. So check with the dads.conf. Please be sure to put /" at the end of the image location. I Forget that slash, later found from the error log.



If you face any errors, look into ORACLE_IAS_ORACLE_HOME/Apache/Apache/logs/error_log.xxxxxxxxxx

Now Oracle E BIZ R12 part.
Copy the apex3.2.zip file to the server where you have to install the Application Express.
Unzip the content into a directory
Source the database environment file

1. Connect as sys user from the directory where you unzipped apex files.
2. run @apexins.sql into the database (my R12 database version is 10.2.0.3)
after completion,
unlock the APEX_PUBLIC_USER account.
Change the password using @apxchpwd.sql from apex directory.

Login to the Application server 10g server.
1. Edit the dads.conf file from /Apache/modplsql/conf/
Now add the entry

<Location pls/apex_R12>
Order deny,allow
PlsqlDocumentPath docs

AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString hostname:port:SID (here my entry is fserver:1521:VIS (MY SID Name is VIS in the EBIZ server)

PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$

PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex

PlsqlDatabasePassword APEX_PASSWORD (here my entry is welcome)
PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
Allow from all

</Location>

Now bounce the Apache of the Application server.

Test the Apex Installation by
http://hostname:port/pls/apex_r12/apex_admin


Troubleshooting is most vulnerable part here.
1. To check wwv_flow_fnd_user schema is locked or not
use
alter session set current_schema=flows_030100
/
select user_name':'account_locked':'security_group_id from wwv_flow_fnd_user
/

2.
TO change the Admin Password:
Changing the Password for the ADMIN Account
In a new installation of Oracle Application Express, or if you are converting a runtime environment to a development environment, you must change the password of the internal ADMIN account. In an upgrade scenario, the password will be preserved and carried over from the prior release.
To change the password for the ADMIN account:

1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role. For example:
On Windows:
SYSTEM_DRIVE:\ sqlplus /nolog
connect sys as sysdba

On UNIX and Linux:
$ sqlplus /nolog
connect sys as sysdba
When prompted, enter the appropriate password.
2. Run apxchpwd.sql. For example:
@apxchpwd
When prompted enter a password for the ADMIN account."

This does not require to change the password in the
ORACLE_HTTPSERVER_HOME/Apache/modplsql/conf/dads.conf File.

3. If You are getting ADMIN/ADMIN_PASSWORD as "Invalid Login Credential Error", then
run
alter user FLOWS_030200 account unlock;

connect as FLOWS_030200 and execute the procedure
begin
wwv_flow_api.set_security_group_id(p_security_group_id=>10);

wwv_flow_fnd_user_api.create_fnd_user(
p_user_name => 'admin2',
p_email_address => 'myemail@mydomain.com',
p_web_password => 'admin2') ;

end;
/

Please be sure
alter user FLOWS_030200 lock;

Then try with "admin2" and "admin2" as password. This should work...

Stuffs to Read
http://download.oracle.com/docs/cd/E10513_01/doc/index.htm

To Remove the APEX installed schema from Oracle database, Run

from apex installed directory

sql>sqlplus "/as sysdba"

sql>@apxremov.sql

Hope this will help you !!!! Cheers!!!

Monday, December 15, 2008

ApEx for Oracle Database (9.2.0.3 - 11.1.0.6)

Apex 3.1 works with all versions above 9203, (including Oracle 11g). In this article the steps are defined for Installing apex_3.1 on 10gR2 (10.2.0.1)

Step 1: Download 10gR2 software (http://www.oracle.com/technology/software/products/database/index.html)
Step 2: Download 10gR2 Companion CD (for HTTP Server) (http://www.oracle.com/technology/software/products/database/index.html)
Step 3: Download apex_3.1 from http://apex.oracle.com or http://www.oracle.com/technology/products/database/application_express/download.html
Step 4: Install 10gR2 software and create a general database as part of installation
Step 5: Install 10gR2 companion CD - you will have two options (HTMLDB + HTTP Server or only HTTP Server) (I selected HTMLDB + HTTP Server, not a must though, since we will be installing apex_3.1)
Step 6: Stop both oracle DB and Apache server just installed.
Step 7: Start the DB and let apache be down.
Step 8: Unzip apex_3.1.zip (hereinafter referred as APEX_LOC)
Step 9: Pre-install requirements for APEX.
1. DB Requirement - Should be greater than 9203.
2. JVM Requirement - Need to be installed separetly if DB is less than 10gR1
3. Shared Pool Size of the database - ignore if sga_target is used, else it has to be atleast 100M;
4. HTTP Server (with mod_plsql) Requirements - Oracle9iR2 (9.2) or later / Oracle9iAS release 1 (1.0.2.2) or later / Oracle Database 10g Companion CD release 1 or 2 / Oracle Database 11g release 1
5. Space Requirement -
For APEX Software Files - 450MB
For APEX objects (tablespace) - 125MB
SYSTEM Tablesapce - 85MB
6. Oracle XML DB Requirement - XML DB should be installed in the database
7. Oracle Text Requirement - for Searchable online help in APEX
8. PL/SQL Web toolkit - required Version 10.1.2.0.6 (10gR2 brings in 10.1.2.0)

In our approach, (10gR2 DB + 10gR2 Companion CD 1) we had satisfied 1,2,3,4 & 6 requirements. Perform below steps to satisfy 5, 7 & 8.

For 5: We can create a separate tablespace for APEX objects or we can use SYSAUX tables. Add appropriate datafiles to the tablespaces to meet the required free space.
For 7: Connect to db as ctxsys user and execute @ORACLE_HOME\ctx\admin\defaults\drdefus.sql (substitute ORACLE_HOME with actual path)
For 8: Go to the location where you had extracted apex_3.1 zip (APEX_LOC). Connect to db as sys user and execute owainst.sql (under apex\owa directory)
Execute “select owa_util.get_version from dual;” to verify the pl/sql web toolkit version.

Step 10: Install APEX 3.1
- Goto the location where you had extracted apex_3.1 zip. change location to apex directory under APEX_LOC.
- Connect to database as sys user and execute below command
- @apexins TS1 TS2 TEMP_TS /i/

TS1 => SYSAUX or (tablespace created for APEX)
TS2 => SYSAUX or (tablespace created for APEX)
TEMP_TS => Temporary tablesapce
/i/ => Location to store APEX Images (no need to mention any path, just leave it as /i/)
eg:(@apexins APEX_DATA APEX_DATA TEMP /i/)

Installation logfile will be located under APEX_LOC as installYYYY-MM-DD_HH24-MI-SS.log.

Step 11: Change Password for ADMIN Account
- Change directory to apex
- Connect to DB as sys user and execute
- @apxchpwd

(ADMIN user is the super user account simillar to SYS for DB)

Step 12: Configure HTTP Server
Step 12.1: Unlock APEX_PUBLIC_USER Account & change password

- Connect to db as sys user
- alter user apex_public_user account unlock;
- alter user apex_public_user identified by NEW_PASSWORD;

Step 12.2: Copy APEX Images
- Open APACHE_ORACLE_HOME/Apache/modplsql/conf/marvel.con to identify default location set for images (/i/) (Hereinafter referred as IMAGE_LOC)
- Goto the location identified above (eg.C:/oracle/product/as/1020/htmldb/images/)
- Rename the images directory to images_old
- Copy APEX_LOC/apex/images to C:/oracle/product/as/1020/htmldb/

Step 12.3: Adding DAD entry to connect to APEX
- Open APACHE_ORACLE_HOME/Apache/modplsql/dad.conf
- Past below entry

Alias /i/ “[ Put the IMAGE_LOC Value] “
AddType text/xml xbl
AddType text/x-component htc


Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString hostname:port:SID
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword APEX_PASSWORD
PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
Allow from all

Make sure these values are properly set before saving this file (marvel.conf)

1. IMAGE_LOC Value
2. hostname:port:SID => eg: localhost:1521:ORCL
3. APEX_PASSWORD => eg: password_you_had_selected_on_step_12.1

IF all the above values are set, save the file as marvel.conf

Step 13: Start HTTP Server (Start -> Programs -> Oracle)

Step 14: Access the admin page of APEX

http://hostname:port/pls/apex/apex_admin

Username: ADMIN
Password: Welcome.

I will keep you posted (Configuration of Apex with Oracle Applications Soon)
Good Luck!!!
Related Posts Plugin for WordPress, Blogger...

Let us be Friends...

Share |

Popular Posts

Recent Comments