• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Hot deploy in weblogic8.1

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you running it on a powerful machine?
what kind of machine r u using for WebLogic?
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I am running it on a P4 2.6Ghz and 2Gb of RAM.
 
Ranch Hand
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Paulo Aquino
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paulo Aquino:


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




Ah never mind, i already got it.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic