tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arend P. van der Veen" <apvanderv...@att.net>
Subject Re: Tomcat on FreeBSD
Date Wed, 22 Aug 2007 12:47:04 GMT
Ronald Klop wrote:
> On Wed Aug 22 04:09:29 CEST 2007 Tomcat Users List 
> <users@tomcat.apache.org> wrote:
>> Ronald Klop wrote:
>> > What java version are you running?
>> > > Ronald.
>> > > On Fri Aug 17 16:00:41 CEST 2007 Tomcat Users List > 
>> <users@tomcat.apache.org> wrote:
>> >> Hi,
>> >>
>> >> I have installed Tomcat 5.5.23_1 on FreeBSD 6.2. I have used 
>> Servlets >> a lot in the past but have not used ant. I am now trying 
>> to get this >> development environment to work. Following the basic 
>> portinstall of >> Tomcat on FreeBSD I did the following:
>> >>
>> >> 1. sudo cp /usr/local/tomcat5.5/server/lib/catalina-ant.jar >> 
>> /usr/local/share/java/apache-ant/lib
>> >>
>> >> 2. Made a sample project
>> >>
>> >> 3. set manager url in build.xml
>> >> <property name="manager.url" value="http://localhost:8180/manager"/>
>> >>
>> >> 4. Chnage permissions in tomcat
>> >>
>> >> cd /usr/local/tomcat5.5]
>> >> sudo chown -R www webapps
>> >>
>> >> Once this was done I was able to compile the project and install it 
>> >> using:
>> >>
>> >> ant
>> >> ant install
>> >>
>> >> I did notice that it created a new directory in webapps with the 
>> new >> application. So far so good. If I try to install it again I get 
>> an >> error stating that it is already installed. Again, so far so good.
>> >>
>> >> The problem that I have is if I make changes to the project and 
>> reload >> the application using
>> >>
>> >> ant reload
>> >>
>> >> I get the following output:
>> >> reload:
>> >> [reload] OK - Reloaded application at context path /hello
>> >>
>> >> This looks ok. However, when I run it, the changes to the project 
>> do >> not show up. If I look into the directory under webapps, the 
>> changes >> have not been moved over. I have to manually copy the 
>> contents from my >> build to webapps under tomcat.
>> >>
>> >> What I am doing wrong. I am sure that it is someting simple but do 
>> not >> seem to figure it out.
>> >>
>> >> Thanks,
>> >> Arend
>> >>
>> > Hi,
>>
>> I am using diablo-jdk-1.5.0.07.01_6
>>
>> Thanks,
>> Arend
>>
>>
> Ok, that works for me. So should work for you. You talk about copying 
> your content from the build to the webapps directory. Why don't you 
> place your build directory in the webapp directory, so building will 
> place the files on the rights location and than reloading is enough.
> 
> Ronald.
> 
Hi,

Thanks for the feedback.  I see your point and now understand how reload 
works.  I think my real problem is with install.  Consider the following 
documentation from web.xml:

The "install" target tells the specified Tomcat 5 installation to 
dynamically install this web application and make it available for 
execution.  It does *not* cause the existence of this web application to 
be remembered across Tomcat restarts; if you restart the server, you 
will need to re-install all this web application.

 From the documentation I thought that install should tell tomcat to 
temporarily load the application stored in build.home.  Instead, what 
happens is "ant install" copies it to the webapps directory.  This is 
permanent.

To demonstrate this consider the following:

# ls /usr/local/tomcat5.5/webapps/
ROOT                    jsp-examples            tomcat-docs
balancer                servlets-examples       webdav

# ant install
Buildfile: build.xml

prepare:

compile:

install:
    [deploy] OK - Deployed application at context path /hello

BUILD SUCCESSFUL
Total time: 2 seconds

# ls /usr/local/tomcat5.5/webapps/
ROOT                    jsp-examples            webdav
balancer                servlets-examples
hello                   tomcat-docs

# ant list
Buildfile: build.xml

list:
      [list] OK - Listed applications for virtual host localhost
      [list] /webdav:running:0:webdav
      [list] /servlets-examples:running:0:servlets-examples
      [list] /jsp-examples:running:0:jsp-examples
      [list] /balancer:running:0:balancer
      [list] 
/host-manager:running:0:/usr/local/tomcat5.5/server/webapps/host-manager
      [list] /tomcat-docs:running:0:tomcat-docs
      [list] /hello:running:0:hello
      [list] /:running:0:ROOT
      [list] /manager:running:0:/usr/local/tomcat5.5/server/webapps/manager

BUILD SUCCESSFUL
Total time: 0 seconds

Notice that hello is now copied into my webapps directory and will be 
there permanently.  Since reload only restarts tomcat and does not 
reinstall my application, I understand why new changes are not be loaded.

I would have expected "ant install" to somehow create a dynamic link 
with what is in ${basedir}/build.  Then when I recompiled my application 
and reloaded tomcat, the new version of the system would run.

I am not sure if there is a configuration parameter in web.xml that is 
effecting the behavior.  I based mine on the copy at:

http://127.0.0.1:8180/tomcat-docs/appdev/build.xml.txt

I only modified what I thought I need to get it to work.

Does install copy the files to your webapp directory also?  Is this 
working the same way for you?

Thanks,
Arend

web.xml






---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message