Tuesday, January 22, 2013
Weblogic Fastswap Implementation
Posted by
Thirunavukkarasu Muthuswamy
at
Tuesday, January 22, 2013
Labels:
Oracle Weblogic Application Server
This time we come up with a interesting functionality FastSwap to SpeedUp Development .We tried to implement this "Fast Swap" feature in one of our J2EE Application that we developed and deploy it in Oracle Weblogic Application Server.
What is FastSwap and how can we achieve it ?
WebLogic’s FastSwap feature is:
1] Enable FastSwap Using Weblogic Deployment descriptors.
2] Turn OFF production mode and switch ON development mode.
3] Deploy the applications in exploded form not in archived form.
Execution part ?
1] Modification of Java Class:
Added this line to to one of the Java Class in Monitoring_Application: System.out.println("From Weblogic GetServerDetails.Class!!").
So now we compiled this modified class and replaced the new .class file and access the application without "Any Rolling Restart" or "New Deployment".
We could see the added System.out.println statement output in weblogic server logs and also note that "Fast Swap" is updating Monitoring_Application at specified interval.
If we implement the same in our development environments , then i think it would reduce some amount of frequent "Deployments" and "Rolling Restarts" for a single class file modification.
Thanks to Oracle for this nice feature. Please share your suggestions and feedbacks.
References:
1] https://blogs.oracle.com/WebLogicServer/entry/using_fastswap_to_speed_up_dev
2] http://docs.oracle.com/cd/E12840_01/wls/docs103/deployment/deployunits.html#wp1053872
What is FastSwap and how can we achieve it ?
WebLogic’s FastSwap feature is:
- Enabled using the WebLogic deployment descriptors
- Available only if the domain is not running in production mode
- Applicable only to Web applications that are not archived
- WebLogic automatically reloads the modified Java class files within applications
- Developers can perform iterative development without an explicit redeployment
- weblogic.xml:
<fast-swap>true</fast-swap>
1] Enable FastSwap Using Weblogic Deployment descriptors.
[thiru@localhost WEB-INF]$ cat weblogic.xml <?xml version="1.0" encoding="UTF-8"?> <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd"> <wls:weblogic-version>12.1.1</wls:weblogic-version> <wls:context-root>Monitoring_Application</wls:context-root> <wls:fast-swap> <wls:enabled>true</wls:enabled> </wls:fast-swap> </wls:weblogic-web-app>
2] Turn OFF production mode and switch ON development mode.
3] Deploy the applications in exploded form not in archived form.
Execution part ?
1] Modification of Java Class:
Added this line to to one of the Java Class in Monitoring_Application: System.out.println("From Weblogic GetServerDetails.Class!!").
So now we compiled this modified class and replaced the new .class file and access the application without "Any Rolling Restart" or "New Deployment".
We could see the added System.out.println statement output in weblogic server logs and also note that "Fast Swap" is updating Monitoring_Application at specified interval.
If we implement the same in our development environments , then i think it would reduce some amount of frequent "Deployments" and "Rolling Restarts" for a single class file modification.
Thanks to Oracle for this nice feature. Please share your suggestions and feedbacks.
References:
1] https://blogs.oracle.com/WebLogicServer/entry/using_fastswap_to_speed_up_dev
2] http://docs.oracle.com/cd/E12840_01/wls/docs103/deployment/deployunits.html#wp1053872
Subscribe to:
Post Comments (Atom)
Thanks, nice post
ReplyDeleteThanks, nice post
ReplyDelete