Contact : oafqueries@gmail.com (OAF/ADF Trainings and Customizations)

Saturday, June 18

SOP's and Compilation Errors in jsp in iStore

Hi,

iStore is totally a JTF based module which works on the jsp concept.

Now when a jsp gets compiled in iStore at run time, where are the compilation errors stored? How do we get to know that what is the compilation erros occured??


Also, if we put SOP's (System.out.println) in jsp where we can see the output??
Answer to this :

The sop's you write in jsps's gets printed in

ORACLE_HOME/Apache/jserv/logs/jserv.log

jsp compilation erros are stored in ssame dir with name as mod_jserv.log



We need jserv logging to be enabled to generate logs.

Steps to enable jserv logging is :

Enable Apache and Jserv debug to match the above debug to validate the above success/debug messages at Apache end
Refer : Basic Apache/mod_jserv Troubleshooting with Hello.class (Doc ID 230688.1)

Thanks,
Gaurav

How to enable logging in iStore

Hi,

Reference :ORACLE CORPORATION http://www.oracle.com How to generate Debug Log Files for Oracle iStore? (Note:207262.1)


I. Purpose To generate debug log files for Oracle iStore. This feature creates separate user log files for both the Java Layer (middle tier) and PL/SQL (database tier) layers.

II. Initial Setup Requirements The following steps are required to be able to log the debug information.
1. Ensure the Logging Parameters in your jserv.properties file are set:
A.
Go to the $APACHE_TOP/Jserv/etc directory and open the jserv.properties file
b. You should have two lines with the following parameters:
wrapper.bin.parameters=-Dframework.Logging.system.filename=/&directory/fwsys.log
wrapper.bin.parameters=-Dservice.Logging.common.filename=/&directory/ibe.log

NOTE: - Replace /&directory/ with a valid directory on your server and make sure it has the proper permissions. - This will not be the name of the log file generated from iStore, see below for the exact name of the log file.

2. Ensure the Debug Properties are turned on for the application:

A. Login to jtflogin.jsp as sysadmin user
B. Navigate to Settings -- System -- Advanced
C. Choose JTF from the dropdown list
D. Verify the following properties are set: framework.Logging.system.filename : fwsys_jtf_log framework.Logging.system.level : debug service.Logging.common.filename : jtf_log service.Logging.common.level : debug service.Logging.common.mode : file
NOTE: - The two *.filename properties are to be set to a name of file, do not enter a directory. - The directory is defined from the parameters set in the jserv.properties. - This will not be the name of the log file generated from iStore, see below for the exact name of the log file.

3. Set the "OM: Debug Log Directory" system profile: Set the Oracle Order Management profile "OM: Debug Log Directory" at the site level to a directory that is writable by the database server. The profile value must be one of the directories listed in the utl_file_dir parameter.

Notes: - To find the utl_file_dir value set, the following query may be executed: select value from v$parameter where name = 'utl_file_dir' - Refer to Note 204016.1 for instructions on updating the utl_file_dir in the init.ora file.

III. Steps to Generate Debug Log Files from iStore

1. Set the Oracle Order Management profile "OM: Debug Level" to 5 at the Site level.

2. If the problem needs Pricing information: please check the "QP: Debug" profile. - If the profile has 'No' and 'Yes' as values, set the profile to 'Yes' at the user level. - If the profile has the 3 values regarding the Request Viewer, set the profile to 'Request Viewer Off'. At this point, the Pricing Debug information will be generated when the "OM: Debug Level" profile is set.

3. If the problem needs the Tax information, the following profiles should also be set: "Tax: Debug File Directory" to the same value as the "OM: Debug Log Directory" profile. "Tax: Debug Flag" to Yes at the user level.

4. If the problem needs the ATP information, the following steps need to be followed: - Set the "MSC: ATP Debug Mode" profile to 'Debug Only' at the site level. - Make sure user level is set to NULL. - A session-* log file will be generated in the 'utl_file_dir' directory.

5. Set the "IBE : Enable Debug" and "ASO : Enable ASO Debug" profiles to Yes at the user level. Both profiles are needed to be set as iStore will call some Order Capture API's.

6. Bounce the apache server to make sure you have a new jserv connection and a new log file is started.

7. Open a new browser window and replicate the issue in iStore

8. Unset the profiles to stop the debugging.

IV. Where are the iStore Debug Log files generated?

1. The iStore pl/sql log file will be generated in the directory (located in the Database Tier) specified in the Order Management 'OM: Debug Log Directory' System Profile and has the syntax of IBE_[username].log

2. The iStore java layer log file will be generated in the directory specified in the 'Dframework.Logging.system.filename' JVM parameter of your Middle Tier (See section II step 1) and has the syntax of IBE_[username]_[generated_id].log Note: Based on the action being done, there might also be a Quoting debug log file generated in the same directory which will have the following syntax: QOT[username]_[generated_id].log Make sure to upload the iStore debug log file and the Quoting if one was generated.

V. Generating Configurator Log Files from iStore If Configurator is involved in the replication steps, some configurator log files can (and should) be obtained for further debugging. For information on how to collect Configurator please refer to Note:313695.1 Note: Other additional notes regarding configurator logging: Note:295930.1 'How to turn off cz logging for the cz*.* logs' , Note:293455.1 (Section: Logging Through the CIO) 'Oracle Configurator Documentation Supplement for Release 11i10 Cumulative Update #1'

VI. Generating Debug Log Files as the guest user To generate the iStore debug log files while you are the guest user, you will just need to append '?&log=t' (without the single quotes) to the end of the URL before the step you want to debug while you are the guest user. There is no need to set all profiles from section III. For example: http://[host]:[port]/OA_HTML/[jsp]?&log=t This will generate the pl/sql and java layer log files for any actions done in that browser after that. You do not have to append the parameter again for that session. Once you close the browser, it stops the debugging. If you start a new browser and append the parameter again, it starts a new set of logs. The logs will be generated the same way for the guest user:
1. The pl/sql file name will have a syntax of "IBE_[guest_partyname].log" and be generated in the directory specified in the "OM: Debug Log Directory" system profile.
2. The java layer file name will have a syntax of "IBE_[guest_partyname]_pgenerated_id].log" and be generated in the directory specified in the 'Dframework.Logging.system.filename' parameter of the jserv.properties.

VII. Generating Debug Log File from the iStore Administration UI Starting from iStore version 11.5.9 (11i.IBE.O),

a debug log file can be generated from the iStore Site Administration User Interface. Login to the Application Forms and set the following System Profiles at the user level to the following values: FND: Debug Log Enabled : Yes FND: Debug Log Module : % FND: Debug Log Level : Statement FND: Debug Log Filename : [path]/ibe_admin.log Note: Replace [path] with the value entered for the "OM: Debug Log Directory" profile. The log file will be called ibe_admin.log and be located in the directory specified in the path entered in the 'FND: Debug Log Filename' profile. Known issues: If you are on 11.5.8 or prior and have applied the 11i.IBE.O patchset, the following patches are required for the debug log file to generate. - Patch 2724762 (WAPSERVLET DISABLES AFLOG) - Patch 2581148 (APPSLOG FAILS TO LOG MESSAGES IN ONE SITUATION) Note: Patch 2581148 is NOT included in Oracle Applications version 11.5.8.

Thanks,
Gaurav

How to export the multiple VO data to excel programatically

Hi,

A lot of times we have the requirement to export table data in excel. We have a standard OAF item called Export Button to do the same but, one export button is attached to one View Object Instance only and it only exports attributes which are shown on to the table region not the hidden attributes.

So, how should we export data from multiple VO's at single button click??

Well, here is the code :

1) Create a submit button on page say : "download"
2) We have multiple VO's for exporting the data
xxcnspDetailsVO1
xxcnRepositoryVO1
xxcntrCallVO1
3) Handle the download button click on PFR of CO as :

if(pageContext.getParameter("download")!=null)
{
String dept_name = null;
String emp_name = null;
String site_name = null;


OAViewObject vo = (OAViewObject)am.findViewObject("xxcnspDetailsVO1");
if(vo!=null)
{
dept_name = (String)vo.first().getAttribute("DeptName");
emp_name = (String)vo.first().getAttribute("Name");
}
OAViewObject repvo = (OAViewObject)am.findViewObject("xxcnRepositoryVO1");
if(vo!=null)
{
site_name = (String)repvo.first().getAttribute("Name");
}
OAViewObject trCallVO = (OAViewObject)am.findViewObject("xxcntrCallVO1");

try
{

HttpServletResponse response = (HttpServletResponse) pageContext.getRenderingContext().getServletResponse();
response.setContentType("application/text");
response.setHeader("Content-Disposition","attachment; filename=" + "Employee Trouble Call Report" + ".csv");
PrintWriter pw = null;
pw = response.getWriter();


pw.write("Department :");
pw.write(",");
if(dept_name !=null) // for null handling in the code
{
pw.write(dept_name);
}
else
{
pw.write(" ");
}

pw.write("\n"); // for going to next line

pw.write("Team :");
pw.write(","); // for going to next cell in excel
pw.write(site_name);
pw.write("\n");

emp_name = emp_name.replaceAll(",",".");
pw.write("Employee :");
pw.write(",");
pw.write(emp_name);
pw.write("\n");
pw.write("\n");
pw.write("\n");

//Writing the headers
pw.write("Customer Number");
pw.write(",");
pw.write("Account");
pw.write(",");
pw.write("Install Repeat Date");
pw.write(",");
pw.write("Work Order Number");
pw.write(",");
pw.write("Work Order Type");
pw.write(",");
pw.write("Problem Code");
pw.write(",");
pw.write("Finding Code");
pw.write("\n");
// getting table data
if(trCallVO!=null)
{
for(xxcntrCallVORowImpl row = (xxcntrCallVORowImpl)trCallVO.first();row!=null;row =(xxcntrCallVORowImpl)trCallVO.next())
{
if(row.getCustNumber()!=null)
{
pw.write(row.getCustNumber());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getAcct()!=null)
{
pw.write(row.getAcct());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getInstRpDate()!=null)
{
pw.write(row.getInstRpDate());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getWoNum()!=null)
{
pw.write(row.getWoNum().intValue());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getWoNum()!=null)
{
pw.write(row.getWoNum().intValue());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getOrdType()!=null)
{
pw.write(row.getOrdType());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getProbCode()!=null)
{
pw.write(row.getProbCode());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getFindingCode()!=null)
{
pw.write(row.getFindingCode());
}
else
{
pw.write(" ");
}
pw.write("\n");
pw.write(" ");
pw.write(",");
pw.write(" ");
pw.write(",");
if(row.getInvDate()!=null)
{
pw.write(row.getInvDate());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getOrderNumber()!=null)
{
pw.write(row.getOrderNumber().intValue());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getAttribute74()!=null)
{
pw.write(row.getAttribute74());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getAttr28()!=null)
{
pw.write(row.getAttr28());
}
else
{
pw.write(" ");
}
pw.write(",");
if(row.getAttr27()!=null)
{
pw.write(row.getAttr27());
}
else
{
pw.write(" ");
}
pw.write("\n");
}
}
pw.write(" ");
pageContext.setDocumentRendered(false); //mandatory
pw.flush(); //exporting data
pw.close();

}
catch(Exception e)
{
e.printStackTrace();
}

}

This way you can include as many VO's as you want.

Thanks,
Gaurav