Sunday 28 April 2013

To compile the jsp as soon as you access jsp page


How to Enable Automatic Compilation of JSP pages in R12 Environment [ID 458338.1].

Metalink details
================
Goal
====
In Release 11i, the deployment of a (custom) JSP was done as follows:

Copy the file (for example: custom.jsp) to the web tier in the $OA_HTML directory.
Request it in the browser like URL> http://<myhost.mydomain>:<port>/OA_HTML/custom.jsp.
The result on the web tier is that:

The custom.jsp was compiled
Output files of the compilation _custom.class (and _custom.java) are saved under the _pages directory
The custom.jsp page is shown in the browser.

Performing the same steps in Release 12 environment just shows a blank screen and no compilation of the custom.jsp is done. 
The steps in this Note explain how the same behavior as in Release 11i can be achieved in Release 12.

Solution
========
In Release 12 the (automatic) compilation of a JSP is disabled and, at runtime, only the pre-compiled JSP's are picked up. Since this requires fewer checks to be done, the performance is improved and therefore this is the recommended and default setting for a Production environment where JSP's will only be replaced occasionally.

In cases where development activities are done and JSP pages are changing often this default setting makes things more complicated. Each time a JSP is deployed a manual compilation using the ojspCompile.pl is needed and the OC4J running the oacore needs a restart to pick up the changes. This will also affect other people working on the same environment.

Follow the steps below to:

Automatically have the JSP recompiled when the JSP is changed (at least the time stamp)
See the new JSP without the need to restart the OC4J running oacore
The objective is to change the setting for main_mode from justrun to recompile in

$INST_TOP /ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml.


<init-param>
         <param-name>main_mode</param-name>
         <param-value>recompile</param-value>
      </init-param>



Lets do it practically.
=============

The objective is to change the setting for main_mode from justrun to recompile in

[applmgr@apps scripts]$ grep -i s_jsp_main_mode $CONTEXT_FILE
         <jsp_debug_parameters oa_var="s_jsp_main_mode">justrun</jsp_debug_parameters>
[applmgr@apps scripts]$

 when i run autconfig it will update $INST_TOP/ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml.

Before running autoconfig the current values in orion-web.xml is .

<init-param>
         <param-name>main_mode</param-name>
         <param-value>justrun</param-value>
</init-param>


I changed the parameter in xml file to recompile.

[applmgr@apps scripts]$ grep -i s_jsp_main_mode $CONTEXT_FILE
         <jsp_debug_parameters oa_var="s_jsp_main_mode">recompile</jsp_debug_parameters>
[applmgr@apps scripts]$

Now running autoconfig.
====================


[applmgr@apps scripts]$ ./adautocfg.sh
Enter the APPS user password:

The log file for this session is located at: /u02/inst/apps/PROD_apps/admin/log/04281239/adconfig.log

AutoConfig is configuring the Applications environment...

AutoConfig will consider the custom templates if present.
        Using CONFIG_HOME location     : /u02/inst/apps/PROD_apps
        Classpath                   : /u02/apps/apps_st/comn/java/lib/appsborg2.zip:/u02/apps/apps_st/comn/java/classes

        Using Context file          : /u02/inst/apps/PROD_apps/appl/admin/PROD_a pps.xml

Context Value Management will now update the Context file

        Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Configuring templates from all of the product tops...
        Configuring AD_TOP........COMPLETED
        Configuring FND_TOP.......COMPLETED
        Configuring ICX_TOP.......COMPLETED
        Configuring MSC_TOP.......COMPLETED
        Configuring IEO_TOP.......COMPLETED
        Configuring BIS_TOP.......COMPLETED
        Configuring AMS_TOP.......COMPLETED
        Configuring CCT_TOP.......COMPLETED
        Configuring WSH_TOP.......COMPLETED
        Configuring CLN_TOP.......COMPLETED
        Configuring OKE_TOP.......COMPLETED
        Configuring OKL_TOP.......COMPLETED
        Configuring OKS_TOP.......COMPLETED
        Configuring CSF_TOP.......COMPLETED
        Configuring IGS_TOP.......COMPLETED
        Configuring IBY_TOP.......COMPLETED
        Configuring JTF_TOP.......COMPLETED
        Configuring MWA_TOP.......COMPLETED
        Configuring CN_TOP........COMPLETED
        Configuring CSI_TOP.......COMPLETED
        Configuring WIP_TOP.......COMPLETED
        Configuring CSE_TOP.......COMPLETED
        Configuring EAM_TOP.......COMPLETED
        Configuring FTE_TOP.......COMPLETED
        Configuring ONT_TOP.......COMPLETED
        Configuring AR_TOP........COMPLETED
        Configuring AHL_TOP.......COMPLETED
        Configuring OZF_TOP.......COMPLETED
        Configuring IES_TOP.......COMPLETED
        Configuring CSD_TOP.......COMPLETED
        Configuring IGC_TOP.......COMPLETED

AutoConfig completed successfully.
[applmgr@apps scripts]$


Once autoconfig completed check context file and orion-web.xml.

[applmgr@apps scripts]$ grep -i s_jsp_main_mode $CONTEXT_FILE
         <jsp_debug_parameters oa_var="s_jsp_main_mode">recompile</jsp_debug_parameters>
[applmgr@apps scripts]$


orion-web.xml.
=============

<init-param>
         <param-name>main_mode</param-name>
         <param-value>recompile</param-value>
</init-param>



Note: JSP’s are compiled automatically after patching (whenever patch updates one or more jsp it calls ojspCompile.pl to compile JSP)

Happy learning!!!!!!!!!!!



To compile jsp's manually in R12 click on the below link and also jsp logs.
http://abduulwasiq.blogspot.in/2013/04/how-to-compile-jsp-in-r12.html



1 comment:

  1. The main motive of the Big data service providers is to spread the knowledge so that they can give more big data engineers to the world.

    ReplyDelete