wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes How to Hot deploy in weblogic8.1  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "How to Hot deploy in weblogic8.1  " Watch "How to Hot deploy in weblogic8.1  " New topic
Author

How to Hot deploy in weblogic8.1

anurag priya
Ranch Hand

Joined: Dec 19, 2000
Posts: 72
Hi all ,
I am using weblogic8.1 server. My problem is, that when i am using Autodeployment (i.e. my application is coppied in the Applications directory of the domain ) , i have to restart the server in case any of the web component is changed . I dont want to Restart the server everytime i compile ( build ) my application . Can Hotdeployment help this ?
if yes how can i Hotdeploy the web application which is changing too frequently ( develepement phase ).
Thanks in advance .
Anurag.


Anurag priya
SCJP 2(83%); Brain Bench Certified for: Masters level EJB2.0(97%) - Masters level J2EE (83%) - BEA-WebLogic Application Server8.1 (86% )
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
You might want to take a look at the docs for the deploy tool. I use it in an ant task and it works well.


<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Vivek Viswanathan
Ranch Hand

Joined: Mar 03, 2001
Posts: 350
That is exactly what I wanted to do, and I solved it today with some help from a colleague at work.

Here is what my problem was:
I am developing server side code (EJBs) that are accessing other server side code (DAOs, Business Objects) I dont change the EJBs often but I do change the Business Objects and DAOs mutiple times during development, and many a times I have to restart the WL server, whcih I dont like doing.

So I wanted to set up hot deployment, which is called as auto-deployment in Weblogic
Here is what I did.
1. Set the WL server to start in DEVELOPMENT mode. Look here to see how to start WL in development mode, so that it supports hot deployment.

2. Created a folder called Someapp (this can be any application name) in the folder domain_name/applications

3. Within this folder I created the following sub folders
Someapp
|
|-----META-INF
| |------application.xml
| |------weblogic-application.xml
|
|-----APP-INF
| |-----classes
| |-----lib
|-----EJBJArred1.jar
|-----WebJArred2.war

EJBJarred1.jar - This a EJB JAR which contains its deployment descriptor and etc - in other words a normal EJB JAR application.
WebJarred2.war - is the similar web application.

Both the EJB JAR and WAR are a part of a single EAR (Someapp).

The META-INF folder contains the descriptors for EAR application.( have a look at J2EE docs for application.xml and WL docs for creating weblogic-application.xml, alternatively you can use Weblogic Builder for creating these descriptors using empty skeletons)

APP-INF ( this is an interesting folder )
--- classes: this folder contains all the class files (DAOs and Business Objects ) that are accceed by the EJBs or any other Web application that is part of the same EAR.
---- lib: this folder should contain only zipped or jarreed class files.

The classes present in 'classes' folder can be present in as a jar in 'lib' folder too but the classes in the 'classes' folder take presedence.

Auto Deployment
Now say that you have made changes to DAO or business objects here is what you have to do.
1. Compile the code and dump the compiled classs files in the 'classes' folder.
2. touch a file called 'REDEPLOY' in the META-INF folder. WL polls for time stamp changes to REDEPLOY file and accordingly deploys the entire EAR again.

Incase you make changes to any EJB.
1. Compile the code.
2. Create the Jar ( appc etc. and descriptors )
3. Overwrite the ejb jar file in Someapp folder
4. touch the REDEPLOY filer in META-INF.


Incase you are interested in how/why WL uses this particular method of hot deployment, have a look at this doc about the WL classloading.

I hope this was helpfull.

I am sorry I have not writted down a more detailed description of what I done since it is 1:30 in the moring and I need to hit the bed, Glad that it is Sat tomorrow and I can sleep late.( I hope my biological alarm doesnt kick in )

[ October 29, 2004: Message edited by: Vivek Viswanathan ]
[ October 29, 2004: Message edited by: Vivek Viswanathan ]

Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1297
are you running it on a powerful machine?
what kind of machine r u using for WebLogic?


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Vivek Viswanathan
Ranch Hand

Joined: Mar 03, 2001
Posts: 350
Well I am running it on a P4 2.6Ghz and 2Gb of RAM.
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Vishwnath,
I am working on weblogic8.1, but I don't see REDEPLOY file in META-INF directory.

I am trying have hot deploy on weblogic8.1(SP4) but couldn't.

I followed all the step you have mentioned. Except REDEPLOY.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Jignesh Patel:
Vishwnath,
I am working on weblogic8.1, but I don't see REDEPLOY file in META-INF directory.



I guess, you need to add that file explicitly when building the ear.
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

Hi Karthik,
I worked out, actually hot deployment is happening but the problem is, I am using java mail api. So whenever I redeploy the application, even though I am making sure that the javax.mail.Session set to Null, I am getting exception
message:Access to default session denied.

Is there any work around so that I will reinitialize mailbox session when I redeploy the application.
Paulo Aquino
Ranch Hand

Joined: Apr 29, 2002
Posts: 200
Originally posted by Karthik Guru:


I guess, you need to add that file explicitly when building the ear.


What could be the contents and file extension of this "Redeploy" file?


Be Afraid...Be very Afraid...
Paulo Aquino
Ranch Hand

Joined: Apr 29, 2002
Posts: 200
Originally posted by Paulo Aquino:


What could be the contents and file extension of this "Redeploy" file?



Ah never mind, i already got it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Hot deploy in weblogic8.1
 
Similar Threads
JSP Compile Error On RedHat Linux ES3 Using WebLogic 8.1
I am not able to run servlet class
Create Ejb aaplication
integrate Jbuilder8.0 with weblogic8.1
question about how to integrate struts web application into Weblogic Portal?