aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Stop/Start Tomcat within eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Stop/Start Tomcat within eclipse" Watch "Stop/Start Tomcat within eclipse" New topic
Author

Stop/Start Tomcat within eclipse

Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
Hi all
Is it possible to stop/start internal eclipse tomcat using ant task?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

There is no Tomcat internal to Eclipse - when you created a Tomcat sever in Eclipse, you had to specify the Tomcat installation directory.


JBoss In Action
Jagdishkumar Patel
Greenhorn

Joined: Apr 30, 2010
Posts: 6
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

Joined: Jul 31, 2003
Posts: 294
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

Joined: Sep 29, 2008
Posts: 12617

Just out of curiosity, why do you want to use the "internal" Tomcat?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16134
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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

Joined: Jul 31, 2003
Posts: 294
I am still trying to overcome restarting tomcat within eclipse,
Any idea will be welcome!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can use whatever Tomcat you want--just configure it in the app servers.
Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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

Joined: Sep 29, 2008
Posts: 12617

Just set up the project to run using that server; Eclipse will handle deployment issues.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Stop/Start Tomcat within eclipse