Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Restarting Tomcat in Eclipse?

 
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Suppose I have a scenario like this where I have a webapp with some servlets and I have run the application by starting tomcat. Now I make some small changes to my servlet and how can I redeploy it without stopping Tomcat?? Is there any facility in the Eclipse IDE for this???

I'm using Lomboz Eclipse IDE with the sysdeo plugin for Tomcat!
 
Saloon Keeper
Posts: 22492
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way is to use Eclipse to build a new WAR, then go to the Tomcat admin webapp and tell Tomcat to upload and deploy that WAR.

It's possible that the "Run on Server" menu option might also be capable of deploying a rebuilt WAR, but I've never tried it.

Mostly when testing I build a Tomcat context XML file and store it in TOMCAT_HOME/conf/Catalina/localhost/ where the codebase for the webapp context is my build directory in the Eclipse project. That way I don't have to build and deploy a WAR -- just do whatever it takes to modify the build directory of the Eclipse project. That's convenient when modifying classes and JSP files, since Tomcat will normally pick up the changes after a minute or 2.

For some things - mostly config file changes and changes to the init code to servlets, a Tomcat restart is required, which the sysdeo plugin makes easy, since all I have to do is click the litle cat buttons on the Eclipse toolbar.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jothi Shankar Kumar Sankararaj:
Guys,

Suppose I have a scenario like this where I have a webapp with some servlets and I have run the application by starting tomcat. Now I make some small changes to my servlet and how can I redeploy it without stopping Tomcat?? Is there any facility in the Eclipse IDE for this???

I'm using Lomboz Eclipse IDE with the sysdeo plugin for Tomcat!



With sysdeo plugin it is very easy.
In the Preference->Tomcat choose Context files instead of Server.xml.
And in your applications context file, use docbase=<path of your docroot> (it can be the path of your docroot in source project) and reloadable=true. All your changes are immediatley effective without restarting tomcat.

HTH
Roshan
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roshan,

I will try this. Maybe if it works well and good!
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roshan,

Can you tell me how to do "And in your applications context file, use docbase= (it can be the path of your docroot in source project) and reloadable=true. All your changes are immediatley effective without restarting tomcat."
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Web Tools Platform plugins with Eclipse. It is availble from Eclipse site itself or from Calisto site.

That enables us to run on web/application servers and even debug server side code.

It supports Tomcat, WebLogic, WebSphere, JBoss etc. So quite helpful...

You can develop your application and eclipse will publish your changes on the fly to the server. At times though.. you may need to restart your server, but that can be done within Eclipse IDE itself.
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sunil,

I'm using Lomboz-Eclipse IDE. The only reason I use this is because it has intellisense and many other features that Eclipse-WTP does not have.
 
My pie came with a little toothpic holding up this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic