Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stop/Start Tomcat within eclipse

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Is it possible to stop/start internal eclipse tomcat using ant task?
 
Peter Johnson
author
Bartender
Posts: 5853
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no Tomcat internal to Eclipse - when you created a Tomcat sever in Eclipse, you had to specify the Tomcat installation directory.
 
Jagdishkumar Patel
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sharon whipple wrote:Hi all
Is it possible to stop/start internal eclipse tomcat using ant task?


Yes,
<target name="start">
<exec executable="cmd">
<arg value="/c"/>
<arg value="${path}/catalina.bat"/>
</exec>
</target>
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jagdishkumar
Executing CMD catalina.bat start
Will start Tomcat in new process, and won’t start the "internal" eclipse tomcat,
Although this is the server path, webapps dir doesn’t contain the deployed war currently under development in eclipse.
Am I missing something?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity, why do you want to use the "internal" Tomcat?
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Just out of curiosity, why do you want to use the "internal" Tomcat?


Probably for debugging. Note that she said the WAR wasn't deployed.

The (never-to-be-sufficiently-accursed) WTP Eclipse plugin makes a copy of some (but not all) of the Tomcat conf directories and files and botches them up, putting the application context elements in the copied server.xml file, despite that being discouraged since the end of life of Tomcat Version 3. So if an external agency attempts to start Tomcat, it won't use the Eclipse copy of the server.xml, unless you go to pains to redirect the CATALINA_BASE to the WTP copy instead of the normal config.

It's all pretty nasty as far as I'm concerned, having enjoyed the more civilized approach of the sysdeo plugin for all those years. Rather than using Ant to start the "Eclipse Tomcat", I'd recommend just starting Tomcat via Eclipse itself.
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Just out of curiosity, why do you want to use the "internal" Tomcat?


We have several grueling process in our app,
for example deploying Web services using Axis and creating the Web services beans,
this process include restarting the server several times,

I am trying to automate these processes using ant.

Nothing I can do to make it ant/ tomcat use the eclipse tomcat instance located at:
.. \workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1

Can i make eclipse deploy the war first to my installed tomcat at "c:\program files\Apache ..."
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still trying to overcome restarting tomcat within eclipse,
Any idea will be welcome!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use whatever Tomcat you want--just configure it in the app servers.
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:You can use whatever Tomcat you want--just configure it in the app servers.

Sorry for my ignorance,
Say my source files are under "c:\myProj", And tomcat is installed under: "c:\Program Files\Apache Software Foundation\Tomcat 5.5"
I can restart the tomcat server under this directory,But how do I make eclipse deploy source files to the tomcat webapps dir?

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just set up the project to run using that server; Eclipse will handle deployment issues.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic