Step 1: Zip Java Class files

cd $COMMON_TOP/java

zip –r /tmp/iStoreLib oracle/apps/fnd oracle/apps/jtf oracle/apps/ibe oracle/apps/ar
oracle/apps/ibc oracle/adf/mds/adapters/FileConstants.class oracle/cabo/ui/UIConstants.class
oracle/fnd com/sun/java/util/collections

Step2 : Zip JSP Files

cd $COMMON_TOP/html

zip /tmp/JSPFiles ibeC*.jsp ibeC*.js jtf*.css jtf*.jsp ibeS*.jsp

Step3 : Zip Images

cd $COMMON_TOP/java/oracle/apps/media/
zip /tmp/IMGFiles ibe* jtf*


Step 4: Create an Application and a Project in Jdeveloper

The project directory will be referred to as <project_dir>.

Step 5: Transfer Files

Copy DBC file from $APPL_TOP/fnd/11.5.0/secure (usually) in <project_dir>
Copy iStoreLib.zip, JSPFiles.zip, IMGFiles.zip into the <project_dir>
Create public_html\OA_HTML under the <project_dir> and extract JSPFiles.zip into this folder.
Create public_html\OA_MEDIA under the <project_dir> and extract IMGFiles.zip into this folder.

Step 6: Project Properties Settings

Adding Libraries to the Project:

Add iStoreLib.zip in project library
Add "Oracle JDBC", "Oracle XML Parser V2", "JSP Runtime" Libraries as well.

Set J2EE Web Context Root to /
Set the JAVA Options to :
-DJTFDBCFILE=<project_dir>\<filename.dbc>
-Dframework.Logging.system.filename=C:/Temp/fwsys.log
-Dservice.Logging.common.filename=C:/Temp/istore.log
Set the program arguments to : intra=t
Set the Runner Options: Uncheck "Before Running Make Project"
Create empty JSP files: amsLitePlacement.jsp, amsWebPlacement.jsp, ibapstng.jsp in
project_dir/OA_HTML directory.

Step 7: Run test scripts

http://www-apps.us.oracle.com/ibe/Architecture/Diagnostics/
( This is an internal link. Please raise an SR with Oracle Support and request for the scripts)

Step 8: Remove duplicate JSP directives

(later version of JSP engine doesn’t allow duplicatedirectives)

Remove language="java" attribute from all JSP files
Remove errorPage="jtfacerr.jsp" from jtfincl.jsp

Step 9 : Additional imports

(later version of JSP engine doesn’t automatically add these imports)

Imports in ibeCZzpHeader.jsp:
Add the following imports :
<%@page import="java.io.*" %>
<%@page import="java.lang.*" %>

Imports in ibeCZzpRuntimeIncl.jsp:

Add the following imports :
<%@page import="java.util.*" %>
<%@page import="java.io.*" %>
<%@page import="java.lang.*" %>

Imports in ibeCCkdBHdrBillPay.jsp :
<%@page import="java.io.*" %>

Imports in ibeCCkdHdrBillPayFlex :
<%@page import="java.lang.reflect.Field" %>


Step 10: Changes in ibeCAcdWelcome.jsp

Replace:
<%@ include file="ibeCWcpESIBinTop.jsp" > with
<%@ include file="ibeCZzpRuntimeIncl.jsp" %>
<% boolean _wcESI = true; %>
Comment the following:
<% @ include file="ibeCWcpESIBinBottom.jsp" %>

Step 11 : Changes in ibeCZzdBinTop.jsp

Comment the following:
<%@page session="false"%>
<% @page errorPage="ibeCZzdError.jsp"%>

Step 12: Changes in ibeCOtcAtp.jsp

Change Message references to oracle.apps.fnd.common.Message

Step 13: Run iStore

The main entry pages to iStore customer facing UI is ibeCZzdMinisites.jsp. (Other entry page are
ibeCZzpEntry.jsp – for deeplink, and ibeCZzpHome.jsp?minisite=<site id>). Add
ibeCZzdMinisites.jsp in your project, compile and run. ibeCZzdMinisites.jsp will redirect to
ibeCCtdMinisites.jsp and list of sites will appear on the browser.

<cookie_domain> is the domain for which iStore cookies will be set – the IP address or domain of
the Windows machine that appears on the browser.


Note
1. Top level JSPs are those that are requested by the browser. They appear on the URL and are part
of HTTP requests and can be compiled. Compile-time included JSPs are included from other JSP files
and cannot be compiled independently. These are included with the tag: <%@ include
file="include_1.jsp" %> and are equivalent to a macro. ibeCZzpHeader.jsp, ibeCZzpTop.jsp,
ibeCZzpMenu.jsp, ibeCZzdBottom.jsp, etc. are compile-time included JSPs. Run-time in
cluded JSPs
are included from other JSP files but can be compiled independently. These are included with the
following tag: <jsp:include page="<%=include_2.jsp%>" flush="true" /> and are equivalent to a
function call. ibeCAcdWelcome.jsp, ibeCCtdSctBrwsBin.jsp, etc. are run-time included JSPs.

Add top level and run-time included JSP files in your project as needed and compile all files in
the project. Alternatively, add all type of JSP files in your project and compile indivi
dually. It
is not necessary to add and compile all top-level and run-time included JSP files. If a JSP file
needed to bring up a page is not pre-compiled, it will be compiled automatically at run time.
Pre-compilation will give faster response at runtime.

2. There are certain instances when Class Not Found Exception is thrown. The Steps below mention
the possible solution for the error noticed.

Example :
1. Assuming that the following Exception is observed, java.lang.ClassNotFoundException:
_oa__html._ibeCCkdHdrBillPayFlex

2. Search the project_dir/classes/.jsps/_oa__html for the file :
* ibeCCkdHdrBillPayFlex*.*
3. Delete the java file and jpa file found in this folder.
4. Compile this jsp through jdeveloper
5. Now the Errors reported are due to some missing imports in the jsp
6. Add the respective import and compile the jsp again. It should compile now without an
y errors
7. Refresh the browser to observe that the ClassNotFoundException observed in Step1 is not seen.

This page contains scripts to diagnose problems to bring up Oracle Application instances. The scripts mainly deal with database connect
ivity and session creation. Remove .txt from file names.

Tip: To diagnose from the command line; compile the .java files and run. This is productive when debug
ging in JDeveloper.

DBC File DB Connection
1. TestDbcConn.jsp:
<%@ page language="java" %>
<%@ page import="oracle.apps.fnd.common.*" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>

<%
try {
String dbcFile = java.lang.System.getProperty("JTFDBCFILE");
out.println("JTFDBCFILE="+dbcFile+"<br>");
if (! new File(dbcFile).canRead()) {
out.println("cant read dbc file<br>");
return;
}
WebAppsContext ctx = new WebAppsContext(dbcFile);
boolean result = connectToJDBC(out, ctx);
ctx.freeWebAppsContext();
} catch (Exception ex)
{
out.println("<PRE>");
ex.printStackTrace(new PrintWriter(out));
out.println("</PRE>");
}
%>

<%!
boolean connectToJDBC(JspWriter o, WebAppsContext ctx)
throws IOException, SQLException
{
AppsEnvironmentStore envStore = (AppsEnvironmentStore)ctx.getEnvStore();
String hostname = envStore.getEnv("DB_HOST");
String portnum = envStore.getEnv("DB_PORT");
String dbname = envStore.getEnv("DB_NAME");
if (dbname == null) dbname = envStore.getEnv("TWO_TASK");
String gwyuid = envStore.getEnv("GWYUID");

String jdbcurl = "jdbc:oracle:thin:" + gwyuid + "@" + hostname +
":" + portnum + ":" + dbname;
o.println("connecting: "+jdbcurl+"<br>");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection gwyconn = DriverManager.getConnection(jdbcurl);
if(gwyconn == null ) {
o.println("connection is null");
return false;
}
o.println("created connection<br>");

ResultSet rs = null;
rs = gwyconn.createStatement().executeQuery("select instance_name from v$instance");
if(rs == null) {
o.println("result set is null");
return false;
}
rs.next();
o.println("instance name: "+rs.getString(1));

rs.close();
gwyconn.close();
return true;
}

void printErrorStack(JspWriter o, WebAppsContext ctx) throws IOException {
o.println("<PRE>");
o.println(ctx.getErrorStack().getAllMessages());
o.println("</PRE>");
}
%>


WebAppsContext DB Connection:
2.TestWacConn.java:

package mypackage;
import oracle.apps.fnd.common.WebAppsContext;
import java.io.*;
import java.sql.*;

public class TestWacConn
{
public static void main(String[] args)
throws SQLException
{
String dbc = System.getProperty("JTFDBCFILE");
System.out.println(dbc);
WebAppsContext wctx = new WebAppsContext(dbc);
Connection conn = wctx.getJDBCConnection();
ResultSet rs = null;
rs = conn.createStatement().executeQuery("select instance_name from v$instance");
if (rs == null) {
System.out.println("result set is null");
return;
}
rs.next();
System.out.println("instance name: "+rs.getString(1));
wctx.freeWebAppsContext();
}
}


WebAppsContext User Session:
3.TestWacSess.java:

package mypackage;
import oracle.apps.fnd.common.WebAppsContext;
import java.io.*;
import java.sql.*;

public class TestWacSess
{
public static void main(String[] args)
throws SQLException
{
String dbc = System.getProperty("JTFDBCFILE");
System.out.println(dbc);
WebAppsContext wctx = new WebAppsContext(dbc);
wctx.createAnonymousSession();
System.out.println(wctx.getSessionId());
System.out.println(wctx.getSessionCookieName());
wctx.releaseJDBCConnection();
wctx.freeWebAppsContext();
}
}


ServletSessionManager User Session:

TestSsmSess.jsp:
<%@page import="oracle.apps.jtf.base.session.*" %>
<%@page import="java.io.*" %>

<% ServletSessionManager.startRequest(request, response, "IBE", true, true); %>
<%=ServletSessionManager.getCookieValue(JTFCookie.USER_NAME) %>
<% ServletSessionManager.endRequest(request, false); %>




.
QUESTION
=========
Request for the script at step6 in Note:419887.1.
This is used in the test of our iStore configurate.


ANSWER
=======
E-Commerce Diagnostics


This page contains scripts to diagnose problems to bring up Oracle Applicatio
n instances. The
scripts mainly deal with database connectivity and session creation. Remove .txt from file names.

Tip: To diagnose from the command line; compile the .java files and run. This is productive when
debugging in JDeveloper.

DBC File DB Connection
1. TestDbcConn.jsp:
<%@ page language="java" %>
<%@ page import="oracle.apps.fnd.common.*" %>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>

<%
try {
String dbcFile = java.lang.System.getProperty("JTFDBCFILE");
out.println("JTFDBCFILE="+dbcFile+"<br>");
if (! new File(dbcFile).canRead()) {
out.println("cant read dbc file<br>");
return;
}
WebAppsContext ctx = new WebAppsContext(dbcFile);
boolean result = connectToJDBC(out, ctx);
ctx.freeWebAppsContext();
} catch (Exception ex)
{
out.println("<PRE>");
ex.printStackTrace(new PrintWriter(out));
out.println("</PRE>");
}
%>

<%!
boolean connectToJDBC(JspWriter o, WebAppsContext ctx)
throws IOException, SQLException
{
AppsEnvironmentStore envStore = (AppsEnvironmentStore)ctx.getEnvStore();
String hostname = envStore.getEnv("DB_HOST");
String portnum = envStore.getEnv("DB_PORT");
String dbname = envStore.getEnv("DB_NAME");
if (dbname == null) dbname = envStore.getEnv("TWO_TASK");
String gwyuid = envStore.getEnv("GWYUID");

String jdbcurl = "jdbc:oracle:thin:" + gwyuid + "@" + hostname +
":" + portnum + ":" + dbname;
o.println("connecting: "+jdbcurl+"<br>");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection gwyconn = DriverManager.getConnection(jdbcurl);
if(gwyconn == null ) {
o.println("connection is null");
return false;
}
o.println("created connection<br>");

ResultSet rs = null;
rs = gwyconn.createStatement().executeQuery("select instance_name from v$instance");
if(rs == null) {
o.println("result set is null");
return false;
}
rs.next();
o.println("instance name: "+rs.getString(1));

rs.close();
gwyconn.close();
return true;
}

void printErrorStack(JspWriter o, WebAppsContext ctx) throws IOException {
o.println("<PRE>");
o.println(ctx.getErrorStack().getAllMessages());
o.println("</PRE>");
}
%>


WebAppsContext DB Connection:
2.TestWacConn.java:

package mypackage;
import oracle.apps.fnd.common.WebAppsContext;
import java.io.*;
import java.sql.*;

public class TestWacConn
{
public static void main(String[] args)
throws SQLException
{
String dbc = System.getProperty("JTFDBCFILE");
System.out.println(dbc);
WebAppsContext wctx = new WebAppsContext(dbc);
Connection conn = wctx.getJDBCConnection();
ResultSet rs = null;
rs = conn.createStatement().executeQuery("select instance_name from v$instance");
if (rs == null) {
System.out.println("result set is null");
return;
}
rs.next();
System.out.println("instance name: "+rs.getString(1));
wctx.freeWebAppsContext();
}
}


WebAppsContext User Session:
3.TestWacSess.java:

package mypackage;
import oracle.apps.fnd.common.WebAppsContext;
import java.io.*;
import java.sql.*;

public class TestWacSess
{
public static void main(String[] args)
throws SQLException
{
String dbc = System.getProperty("JTFDBCFILE");
System.out.println(dbc);
WebAppsContext wctx = new WebAppsContext(dbc);
wctx.createAnonymousSession();
System.out.println(wctx.getSessionId());
System.out.println(wctx.getSessionCookieName());
wctx.releaseJDBCConnection();
wctx.freeWebAppsContext();
}
}


ServletSessionManager User Session:

TestSsmSess.jsp:
<%@page import="oracle.apps.jtf.base.session.*" %>
<%@page import="java.io.*" %>

<% ServletSessionManager.startRequest(request, response, "IBE", true, true); %>
<%=ServletSessionManager.getCookieValue(JTFCookie.USER_NAME) %>
<% ServletSessionManager.endRequest(request, false); %>

以下是最新的iStore配置文档  Setting up Jdeveloper 10.1.2 for iStore 11.5.10
请点击此处
posted on 2007-06-26 14:10 湘江夜游神 阅读(1650) 评论(0)  编辑  收藏 所属分类: ORACLE

Locations of visitors to this page