Hi,

Jay SenSharma

Jay SenSharma

APPC is a WebLogic Specific Application Compiler tool. This tool is very useful in order to compile our applications according to the current version of WebLogic. Usually we use this tool to compiles EJBs and JSPs.

Here is a Simple example of APPC anttask…which compiles An EAR application which contains Multiple WAR files….the Output of the compilation will be placed in the location specified in “output” attribute of this Task, which can be deployed on WebLogic Server to avoid Deploy time Compilation Overhead.

Step1). Suppose we have a Simple EAR Application “TestDiagnosticsEAR” (you can even use WAR/JAR/EAR archieved or Un-Archived versions to compile) in the following location in our file System…”C:DELETEBLOG_REPLYAPPC”

Step2). Now write “build.xml” file in “C:DELETEBLOG_REPLYAPPC” Location…

<project name="WeblogicCompilation" basedir="." default="appc">
<property name="wl.home" value="C:/bea103/wlserver_10.3" />
<property name="application.dir" value="C:/DELETE/TestDiagnosticsEAR" />

<path id="wlappc.classpath">
        <fileset dir="${wl.home}/server/lib">
              <include name="*.jar"/>
        </fileset>
</path>

<taskdef name="wlappc" classpathref="wlappc.classpath" classname="weblogic.ant.taskdefs.j2ee.Appc"/>

<target name="appc">
<wlappc source="${application.dir}"
        keepgenerated="true"
        verbose="true"
        output="${application.dir}_Output"/>
</target>
</project>

Step3). Now run the Above ANT Script:

after setting the JAVA_HOME and ANT_HOME Better And Recommended if you will run “. ./setWLSEnv.sh” from WebLogic server/bin directory.

Note: “. ./setWLSEnv.sh”       The first DOT represents that set the Environment in the current Shell, AND the second ./ represents execute the script from the current directory. Both DOTs are separated by a single white space character.

Step4). Analyze the “output=”${application.dir}_Output” directory …you will find that all your JSPs and EJBs(if any) are compiled.

—————————

Output:

C:DELETEBLOG_REPLYAPPC>ant
Buildfile: build.xml

appc:
[wlappc] <Feb 8, 2010 4:52:03 PM IST> <Info> <J2EE> <BEA-160186> <Compiling EAR module ‘SecondWebApp_A’>
[wlappc] [JspcInvoker]Checking web app for compliance.
[wlappc] [jspc] Overriding default descriptor option ‘keepgenerated’ with value specified on command-line ‘true’
[wlappc] [jspc] -webapp specified, searching . for JSPs
[wlappc] [jspc] Compiling /index.jsp
[wlappc] <Feb 8, 2010 4:52:06 PM IST> <Info> <J2EE> <BEA-160186> <Compiling EAR module ‘SecondWebApp_B’>
[wlappc] [JspcInvoker]Checking web app for compliance.
[wlappc] [jspc] Overriding default descriptor option ‘keepgenerated’ with value specified on command-line ‘true’
[wlappc] [jspc] -webapp specified, searching . for JSPs
[wlappc] [jspc] Compiling /index.jsp
[wlappc] Compilation completed successfully.

BUILD SUCCESSFUL
Total time: 5 seconds
————————–

Thanks

Jay SenSharma

If you enjoyed this post, please considerleaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.