Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Re-deploying tomcat 5.5
Re-deploying tomcat 5.5 [message #205646] Wed, 12 December 2007 16:49 Go to next message
Eclipse UserFriend
Originally posted by: ranavishal.gmail.com

Hello All,

Just a quick question:
Do I need to restart the server everytime I make changes in web.xml, java
file or any other configuration file like struts-config.xml

Development Env.
Eclipse wtp 2.0.1
Tomcat 5.5

PS: Tomcat configured inside the eclipse

Thanks
Vishal
Re: Re-deploying tomcat 5.5 [message #205653 is a reply to message #205646] Wed, 12 December 2007 17:28 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Vishal Rana wrote:
> Hello All,
>
> Just a quick question:
> Do I need to restart the server everytime I make changes in web.xml,
> java file or any other configuration file like struts-config.xml
>
> Development Env.
> Eclipse wtp 2.0.1
> Tomcat 5.5
>
> PS: Tomcat configured inside the eclipse
>
> Thanks
> Vishal
>

For these kinds of files, when the change is published to the Tomcat
server, if the change triggers a context reload, then you can probably
skip the restart. However, it is fairly typical for the old context to
"leak" and not be fully garbage collected. After some number of
reloads, the server may run out of memory and restart will be needed to
clean things up.

Cheers,
Larry
Re: Re-deploying tomcat 5.5 [message #205677 is a reply to message #205653] Wed, 12 December 2007 18:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ranavishal.gmail.com

Thanks, do we have any option to redeploy the application right from the
eclipse?
Re: Re-deploying tomcat 5.5 [message #205685 is a reply to message #205677] Wed, 12 December 2007 19:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Vishal Rana wrote:
> Thanks, do we have any option to redeploy the application right from the
> eclipse?
>
I'm not sure exactly what you mean by "redeploy". If you mean force a
context reload, the answer is no. The Tomcat support in WTP currently
doesn't support control of the Tomcat server beyond starting and
stopping and what "control" can be accomplished via the configuration files.

Cheers,
Larry
Re: Re-deploying tomcat 5.5 [message #205692 is a reply to message #205685] Wed, 12 December 2007 19:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ranavishal.gmail.com

Thanks for your help :)
Re: Re-deploying tomcat 5.5 [message #205717 is a reply to message #205685] Thu, 13 December 2007 12:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

Larry Isaacs wrote:
> Vishal Rana wrote:
>> Thanks, do we have any option to redeploy the application right from
>> the eclipse?
>>
> I'm not sure exactly what you mean by "redeploy". If you mean force a
> context reload, the answer is no. The Tomcat support in WTP currently
> doesn't support control of the Tomcat server beyond starting and
> stopping and what "control" can be accomplished via the configuration
> files.
>
> Cheers,
> Larry

Not exactly sure this is a *good* answer to this question, but I have
also been struggling with this lack of control, so I have for mature
projects switched to a pure Java project with a setup where classes are
created as required by Tomcat and and in the
apache-tomcat-6.0.14\conf\Catalina\localhost directory I have created a
file which contains:
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="C:/eclipse_projects/MyApp/web" reloadable="true"/>

This works fine for the reload scenario and for session (and other)
control I use the admin app.

This of course excludes me from all nice WTP features but give me more
control over my TomCat apps.

:) Goran Rehnlund
Re: Re-deploying tomcat 5.5 [message #205725 is a reply to message #205717] Thu, 13 December 2007 13:16 Go to previous message
Eclipse UserFriend
Originally posted by: wojtekmichalik.softtellco.com.pl

<path id="master-classpath">
<fileset dir="${web.dir}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<!-- We need the servlet API classes: -->
<!-- for Tomcat 4.1 use servlet.jar -->
<!-- for Tomcat 5.0 use servlet-api.jar -->
<!-- for Other app server - check the docs -->
<fileset dir="${appserver.home}/common/lib">
<include name="servlet*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
</path>

<target name="usage">
<echo message=""/>
<echo message="${name} build file"/>
<echo message="-----------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="build --> Build the application"/>
<echo message="deploy --> Deploy application as directory"/>
<echo message="deploywar --> Deploy application as a WAR file"/>
<echo message="install --> Install application in Tomcat"/>
<echo message="reload --> Reload application in Tomcat"/>
<echo message="start --> Start Tomcat application"/>
<echo message="stop --> Stop Tomcat application"/>
<echo message="list --> List Tomcat applications"/>
<echo message=""/>
</target>

<target name="build" description="Compile main source tree java
files">
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" target="1.3" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
</javac>
</target>

<target name="deploy" depends="build" description="Deploy
application">
<copy todir="${deploy.path}/${name}" preservelastmodified="true">
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
</copy>
</target>

<target name="deploywar" depends="build" description="Deploy
application as a WAR file">
<war destfile="${name}.war"
webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
</war>
<copy todir="${deploy.path}" preservelastmodified="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>

<!-- ============================================================ == -->
<!-- Tomcat tasks - remove these if you don't have Tomcat installed -->
<!-- ============================================================ == -->

<taskdef name="install"
classname="org.apache.catalina.ant.InstallTask">
<classpath>
<path location="${appserver.home}/server/lib/catalina-
ant.jar"/>
</classpath>
</taskdef>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
<classpath>
<path location="${appserver.home}/server/lib/catalina-
ant.jar"/>
</classpath>
</taskdef>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath>
<path location="${appserver.home}/server/lib/catalina-
ant.jar"/>
</classpath>
</taskdef>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath>
<path location="${appserver.home}/server/lib/catalina-
ant.jar"/>
</classpath>
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath>
<path location="${appserver.home}/server/lib/catalina-
ant.jar"/>
</classpath>
</taskdef>

<target name="install" description="Install application in Tomcat">
<install url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"
war="${name}"/>
</target>

<target name="reload" description="Reload application in Tomcat">
<reload url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"/>
</target>

<target name="start" description="Start Tomcat application">
<start url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"/>
</target>

<target name="stop" description="Stop Tomcat application">
<stop url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="/${name}"/>
</target>

<target name="list" description="List Tomcat applications">
<list url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"/>
</target>
Previous Topic:edit HTML file
Next Topic:Tag File Validation Bugs?
Goto Forum:
  


Current Time: Tue Apr 16 13:26:15 GMT 2024

Powered by FUDForum. Page generated in 0.55396 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top