Friday, December 24, 2010

Using FastSwap

Using FastSwap Deployment to Minimize Redeployment

http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/deployunits.htm




Ant build script using FastSwap ant task

<project basedir="." default="deploy" name="deploy">
<property environment="env"/>

<property name="wl.home" value="/app/wlserver_10.3"/>
<property name="application.dir" value="/home/dave/workspace/wls1033/.metadata/.plugins/org.eclipse.core.resources/.projects/testEAR/beadep/base_domain/testEAR/" />

<echo message="${wl.home}/server/lib"/>

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

<echo message="${toString:wlappc.classpath}"/>

<taskdef name="wlappc" classpathref="wlappc.classpath" classname="weblogic.ant.taskdefs.j2ee.Appc"/>
<taskdef name="wldeploy" classpathref="wlappc.classpath" classname="weblogic.ant.taskdefs.management.WLDeploy"/>
<taskdef name='fast-swap' classpathref="wlappc.classpath" classname='com.bea.wls.redef.ant.FastSwapTask'/>


<target name="deploy">
<wldeploy user="weblogic"
password="weblogic123"
verbose="true"
adminurl="t3://localhost:7001"
targets="AdminServer"
action="deploy"
source="${application.dir}"
name = "testEAR"
/>
</target>


<target name="fast-swap">
<fast-swap user="weblogic"
password="weblogic123"
adminurl="t3://localhost:7001"
server="AdminServer"
application = "testEAR"
/>
</target>

</project>





Ant build script output
Buildfile: /home/dave/workspace/wls1033/testEAR/build.xml
[echo] /app/wlserver_10.3/server/lib
[echo] /app/wlserver_10.3/server/lib/weblogic.jar
fast-swap:
[fast-swap] Performing FastSwap.
[fast-swap] adminUrl: t3://localhost:7001
[fast-swap] server: AdminServer
[fast-swap] application: testEAR
[fast-swap] module: null
[fast-swap] classes:
[fast-swap] Using JMX Connector to connect to service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime
[fast-swap] Processed 1 classes from 1 candidate classes.
[fast-swap] FastSwap operation completed successfully.
[fast-swap] ----------------------------------------------------
BUILD SUCCESSFUL


AdminServer log
####<Dec 24, 2010 8:33:14 AM CET> <Info> <FastSwap> <dave> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1293175994484> <BEA-2154001> <Starting FastSwap operation on application "testEAR".> 
####<Dec 24, 2010 8:33:14 AM CET> <Info> <FastSwap> <dave> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1293175994527> <BEA-2154002> <Finished FastSwap operation on application "testEAR" with status FINISHED.>



<!--
Redefine classes which have changed since they were last loaded.
Required parameters:
adminUrl: Connection url
user: User name
password: User password
server: Managed server name
application: Deployed application name
Optional parameters:
module: Name of the module within the application.
If not specified, all modules within the application
will be processed.
failonerror: Default=true. If true, task will fail if fast-swap failed.
Otherwise, a message will be displayed and the task will
return success.
timeout: Default=300. Timeout in seconds.
classnames: Comma separated list of classnames to process. If not
specified, all classes within specified modules (if any)
in the application will be considered.
-->

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. hey hi i am using t3://localhost:7001 but i am getting Unsupported protocol t3

    ReplyDelete