Caldarale, Charles R wrote:
From: Daniel Gresh [mailto:[EMAIL PROTECTED]
Subject: Ant custom tasks: how to compile .java files and
restart Tomcat (Tomcat6.0.9)?
I have a src directory for my .java files that I wish
to compile to .class files and simply store them on
$CATALINA_HOME/webapps/ROOT for now.
Immediately under a webapp directory is not an appropriate location for
class files - ever. They should go into
webapps/[appname]/WEB-INF/classes, as defined by the servlet spec.
Ah sorry about this - my files are under /WEB-INF/classes. I forgot to
specify this.
However, I am not necessarily restarting an app; I
wish to restart Tomcat.
Why? There's no reason to do so, if all you're doing is updating the
app. Restarting Tomcat requires running the shutdown and startup
scripts.
I know restarting Tomcat requires running the shutdown and startup
scripts. The reason I want to restart Tomcat is because I will be
deploying/updating ............ wait.
Is webapps/[appname], where [appname]=ROOT a web application? If so, I
can just use reload when I deploy new .class files without ever having
to restart Tomcat, right?
Wow, that realization just hit me like a truck.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Alright, here is where I am now.
I edited my build.xml file to include a reload command to reload my
$CATALINA_HOME/webapps/ROOT path. I go to the directory where my .java
files are and type "ant reload". Everything in the build.xml file works
fine until it reaches reload. Once it reaches reload, I get the
following message:
reload:
[reload] FAIL - No context exists for path
/u/dgresh/apache-tomcat-6.0.9/webapps/ROOT
BUILD FAILED
/u/dgresh/dev/kdb/src/kdb4/build.xml:44: FAIL - No context exists for
path /u/dgresh/apache-tomcat-6.0.9/webapps/ROOT
I do not understand this. In the example build.xml file provided on the
Apache Tomcat website, it says this:
The "reload" signals the specified application Tomcat 5 to shut itself down
and reload. This can be useful when the web application context is not
reloadable and you have updated classes or property files in the
/WEB-INF/classes directory or when you have added or updated jar files in the
/WEB-INF/lib directory.
I am updating classes in the /WEB-INF/classes directory, which is why I
want to reload the application. Is there something I am missing? Is
there something I need to include in $CATALINA_HOME/webapps/ROOT to make
it a web application so Ant can recognize the context?
Thanks for the help,
Dan
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]