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.
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 ]
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.