• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically reloading servlets

 
Ankit Garg
Sheriff
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ankit Garg
Sheriff
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right. That would certainly cause problem. That's why I like Web applications. They take seconds to get deployed

Thanks Jaikiran
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic