• 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

Dynamically reloading servlets

 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic