aspose file tools*
The moose likes JBoss/WildFly and the fly likes Dynamically reloading servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Dynamically reloading servlets" Watch "Dynamically reloading servlets" New topic
Author

Dynamically reloading servlets

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Hi!

I use jBoss as the AS for my EJB application (its an enterprise application i.e. EAR). I deploy the code in exploded form as explained here. Now the problem is that the changes to JSPs are reflected as soon as they are updated. But the changes to EJBs, Servlets and other classes is not reflected after changes are made to them. I have to restart my server each time to make the changes take effect. This takes a lot of time. Is there a direct way in which jBoss would reload classes in my project. If it is not possible for EJBs, then its fine but if this can happen at least for Servlets and other classes in the web application in the enterprise application, then it would be great.

I would be thankful for any help...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10113
    
165

But the changes to EJBs, Servlets and other classes is not reflected after changes are made to them. I have to restart my server each time to make the changes take effect.


Changes to .class files needs a application redeployment or a server restart. Since you are already using exploded deployment, you can just "touch" the top-level deployment descriptor of the EAR (application.xml) to redeploy the application without restarting the server. See this.

By the way, which application server do you use? I ask this because hotdeployment of applications in an "external" deploy folder was not supported in 4.2.x, as far as i remember.


[My Blog] [JavaRanch Journal]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Thanks Jaikiran. I'm using jBoss 4.0.4. Well what you told works. I "touched" the application.xml and the application got redeployed. Then I tried to "touch" the web.xml inside the ear but the web application didn't get deployed as a separate unit. If that would have worked, I could save my time for the redeployment of the EJBs. But I guess that is asking just too much from the server to re-deploy a part of the full enterprise application...
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10113
    
165

Ankit Garg wrote:Then I tried to "touch" the web.xml inside the ear but the web application didn't get deployed as a separate unit. If that would have worked, I could save my time for the redeployment of the EJBs. But I guess that is asking just too much from the server to re-deploy a part of the full enterprise application...


Deploying only a part of the application would cause problems. Imagine some components in the application still using the older version of the other component which you redeployed.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Yes you are right. That would certainly cause problem. That's why I like Web applications. They take seconds to get deployed

Thanks Jaikiran
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically reloading servlets