Many times we faces an issue which needs JSPs to be compiled, specially in case of development. Also for example, if some of the class files are missing then, in that case we can compile the JSPs and get the required class files.
In Oracle Applications (11i as well as R12), we have a utility called ojspCompile.pl. This script carries out compilation of JSPs. Below is some information regarding this script.
Oracle Apps 11i
In 11i version, this script is present in JTF_TOP/admin/scripts
===========================================================
(appmgr01) scripts – -bash $ ./ojspCompile.pl
syntax: ./ojspCompile.pl COMMAND {ARGS}
COMMAND –compile update dependency, compile delta
–create rebuild entire dependency file
-delta.out <file> update dependency, list delta to file
-dep.out <xmlfile> update dependency, output heirarchy to file
ARGS -s <regex> matching condition for JSPs filenames
-p <procs> number of parallel compilations
-log <file> to override logfile from ojspCompile.conf
-conf <file> to override ojspCompile.conf
–retry retry previously failed compilation attempts
–flush forces recompilation of all parent JSPs
–quiet do not provide an actively running progress meter
–fast instantly fail jsps that are *possibly* invalid
example1: ojspCompile.pl –compile -s ‘jtf%’ -p 20 –retry
example2: ojspCompile.pl –compile -s ‘jtflogin.jsp,jtfavald.jsp’ –flush
example3: ojspCompile.pl –compile –fast –quiet
===========================================================
We can run the script using the above parameters. Example
===========================================================
(appmgr01) scripts – -bash $ ./ojspCompile.pl –compile –quiet
identifying apache_top…/slot01/appmgr/plmmtqaeora/iAS
identifying apache_config_top…/slot01/appmgr/plmmtqaeora/iAS
identifying java_home…/local/java/jdk1.4.2_04
identifying jsp_dir…/slot01/appmgr/plmmtqaecomn/html
identifying pages_dir…/slot01/appmgr/plmmtqaecomn
identifying classpath…file:///slot01/appmgr/plmmtqaeora/iAS/Apache/Jserv/etc/jserv.properties
auto-logging to /slot01/appmgr/plmmtqaecomn/_pages/ojsp_error.log
starting…(compiling delta)
using 8i internal ojsp ver: 1.1.3.5.1
including compatibility flag -whiteSpaceBetweenScriptlet
synchronizing dependency file:
enumerating jsps…15390
parsing jsp…15390
writing deplist…15390
initializing compilation:
eliminating children…12220 (-3170)
searching uncompiled…12199
translating and compiling:
searching untranslated…12199
translating jsps…12199/12199 [failed: 3] in 3m43s
compiling jsps… 51% complete: 6250/12196 ETA: 4m47s
compiling jsps…12196/12196 in 8m44s
Finished!
===========================================================
Using parameters –compile –quiet will compile only those JSPs which are invalid and needs compilation.
If you want to compile all JSPs (irrespective of status), then you need to use –compile –flush as parameters to osjpCompile.pl.
Doing these will replace all the .class files in _pages directory under COMMON_TOP (which is a kind of cache for JSPs).
Also in case of 11i, automatic recompilation of JSPs are done when we access the JSP. This is the default and only behavior. So in case if you delete _pages directory under COMMON_TOP, we can always recreate the same by running osjpCompile.pl or accessing the application directly.
In case we access application directly without running ojspCompile.pl, the access will be little slower, since it will be doing compilation as well.
Oracle E-Business Suite R12
In case of Oracle E-Business suite R12, same ojspCompile.pl script is present for compiling JSPs, but this script is present under FND_TOP/patch/115/bin directory.
Also, you cannot delete _pages directory under COMMON_TOP. Deleting this will make your application non-workable.
The reason for the same being that, in case of R12, JSPs are not compiled as and when you access them. So dynamic compilation of JSPs are not present. This is basically done to improve the performance of application system. But in case _pages directory has been deleted, then you can recreate the same by running ojspCompile.pl –compile –flush command.
Also some times, its required to have dynamic compilation of JSPs, specially in case of development environment, so that oacore will pick the latest changes. This setting can be done using a parameter in CONTEXT_FILE. The paramter name is s_jsp_main_mode.
This parameter is by default having a value of justrun, this can be changed to recompile. Once changed, you can run autoconfig and Verify that the $INST_TOP/ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml has
<init-param> <param-name>main_mode</param-name> <param-value>recompile</param-value> </init-param>
Doing this will make new JSP to get compiled before it is shown on browser.
References:
Metalink Note ID 458338.1
Hi,
I cant find the ojspCompile.pl file in the FND_TOP/patch/115/bin directory !!
Can you help in that?
Thanks
Hi,
You will find in $JTF_TOP/admin/scripts.
Please check & let me know if not available.
Regards,
Vikhyath Shetty