Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Start Tomcat within eclipse from ANT task
icon5.gif  Start Tomcat within eclipse from ANT task [message #541938] Wed, 23 June 2010 05:46 Go to next message
Sharon Whipple is currently offline Sharon Whipple
Messages: 7
Registered: July 2009
Junior Member
Hi all

I am trying to restart Eclipse internal Tomcat in order to automate some deployment process of our web services within eclipse.

To start tomcat in my IDE I click the start tomcat within the Eclipse IDE (see attached Image)http://techteam.files.wordpress.com/2009/02/m77cdad3d.png
I would like to be able to start the same Tomcat using ANT,

If I will start tomcat normally from :
c:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\startup.bat
I will have to make sure that my web project is deployed to
c:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\

If I will be able to start the IDE tomcat server then the IDE will take care of the deployment to its internal webapps (or linkage to webapps)

Thank you.
Sharon

http://techteam.files.wordpress.com/2009/02/m77cdad3d.png
Re: Start Tomcat within eclipse from ANT task [message #542659 is a reply to message #541938] Fri, 25 June 2010 10:38 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1298
Registered: July 2009
Senior Member
On 6/23/2010 5:46 AM, Sharon Whipple wrote:
> Hi all
>
> I am trying to restart Eclipse internal Tomcat in order to automate some
> deployment process of our web services within eclipse.
>
> To start tomcat in my IDE I click the start tomcat within the Eclipse
> IDE (see attached
> Image)http://techteam.files.wordpress.com/2009/02/m77cdad3d.png
> I would like to be able to start the same Tomcat using ANT,
>
> If I will start tomcat normally from :
> c:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\startup.bat
> I will have to make sure that my web project is deployed to c:\Program
> Files\Apache Software Foundation\Tomcat 5.5\webapps\
>
> If I will be able to start the IDE tomcat server then the IDE will take
> care of the deployment to its internal webapps (or linkage to webapps)
>
> Thank you.
> Sharon
>
>

If you start the Tomcat server in Eclipse, switch to the Debug
perspective and go to the Debug view, you can right-click on the first
subitem in the tree and select "Properties". The dialog that appears
will show you the Java command line that runs the Tomcat server.
Executing this command outside of Eclipse or within Ant will run the
Tomcat server in exactly the same way that Eclipse does. What this
doesn't do that the "Start Server" command in Eclipse typically does is
force changes to be published. I'm not sure how or if that can be done
from Ant.

Cheers,
Larry
Re: Start Tomcat within eclipse from ANT task [message #544019 is a reply to message #541938] Thu, 01 July 2010 07:32 Go to previous messageGo to next message
Sharon Whipple is currently offline Sharon Whipple
Messages: 7
Registered: July 2009
Junior Member
Thank you Larry,
I was able to find the command :

"C:\Program Files\Java\jdk1.5.0_13\bin\java.exe"
agentlib:jdwp=transport=dt_socket,suspend=y,address=localhos t:2468
"-Dcatalina.base=C:\Documents and Settings\sharonw\workspace\.metadata\.plugins\org.eclipse.ws t.server.core\tmp1 "
"-Dcatalina.home=c:\Program Files\Apache Software Foundation\Tomcat 5.5"
"-Dwtp.deploy=C:\Documents and Settings\sharonw\workspace"
"-Djava.endorsed.dirs=c:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed"
-Xms256m -Xmx1024m -XX:PermSize=-XX:MaxPermSize=256m -Dfile.encoding=Cp1255
"-Xbootclasspath:C:\PATH..." org.apache.catalina.startup.Bootstrap start


But it fail to run:

ERROR: transport error 202: connect failed: Connection refused ["transport.c",L41]
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
JDWP exit error JVMTI_ERROR_INTERNAL(113):
No transports initializedFATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)

[Updated on: Thu, 01 July 2010 07:34]

Report message to a moderator

Re: Start Tomcat within eclipse from ANT task [message #545094 is a reply to message #544019] Tue, 06 July 2010 10:59 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1298
Registered: July 2009
Senior Member
On 7/1/2010 7:32 AM, Sharon Whipple wrote:
> Thank you Larry,
> I was able to find the command :
>
> "C:\Program Files\Java\jdk1.5.0_13\bin\java.exe"
> agentlib:jdwp=transport=dt_socket,suspend=y,address=localhos t:2468
> "-Dcatalina.base=C:\Documents and
> Settings\sharonw\workspace\.metadata\.plugins\org.eclipse.ws
> t.server.core\tmp1 " "-Dcatalina.home=c:\Program Files\Apache Software
> Foundation\Tomcat 5.5" "-Dwtp.deploy=C:\Documents and
> Settings\sharonw\workspace" "-Djava.endorsed.dirs=c:\Program
> Files\Apache Software Foundation\Tomcat 5.5\common\endorsed" -Xms256m
> -Xmx1024m -XX:PermSize=-XX:MaxPermSize=256m -Dfile.encoding=Cp1255
> "-Xbootclasspath:C:\PATH..." org.apache.catalina.startup.Bootstrap start
> :blush:
> But it fail to run:
>
> ERROR: transport error 202: connect failed: Connection refused
> ["transport.c",L41]
> ERROR: JDWP Transport dt_socket failed to initialize,
> TRANSPORT_INIT(510) ["debugInit.c",L500]
> JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports
> initializedFATAL ERROR in native method: JDWP No transports initialized,
> jvmtiError=JVMTI_ERROR_INTERNAL(113)

The fact that you get this outside of Eclipse indicates it's a problem
between Java and your system. Google may be able to provide an answer.
You might start with this one:

http://wiki.eclipse.org/Debug_FAQ#I_can_run_a_program_but_no t_debug_it.3F.3F.3F

Cheers,
Larry
Previous Topic:JSF 2.0 completion in .xhtml files with Eclipse 3.6 M6
Next Topic:why jst.server.tomcat not extended from jst.server.generic?
Goto Forum:
  


Current Time: Mon Jul 28 00:25:42 EDT 2014

Powered by FUDForum. Page generated in 2.10121 seconds