tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karsten Wutzke <kwut...@web.de>
Subject Re: Installs/deploys to work dir... why?
Date Wed, 16 Apr 2003 15:19:23 GMT
It's really nothing special. Currently, I'm starting to develop a 
JSP/Servlet web app which connects to a MySQL 4 DB to retrieve 
Basketball statistics of players, games, teams etc. I started with Ant 
to create an automation framework. I'm working on my localhost right 
now, but I want to do the things in a way, so that I can use as much of 
the XML code as possible for bringing the whole thing over to a remote 
server...

For now, I have created two Ant targets, <install-local> and 
<deploy-local> doing the *exactly* the same. I did this just to find out 
which task does what I expect. In the end, both tasks successfully get 
the web app up and running, but in Tomcat directories I did *not* expect.

Here's some code, nothing special (local means Tomcat on the localhost):

<property name="local.manager.url" value="http://localhost:8080/manager"/>
<property name="local.manager.username" value="anything"/>
<property name="local.manager.password" value="anything"/>
<property name="local.context.path" value="/basketball"/>
<property name="dist.file" location="dist/basketball.war"/>

<target name="deploy-local" depends="dist,startup-local">
   <deploy url="${local.manager.url}"
           username="${local.manager.username}"
           password="${local.manager.password}"
           path="${webapp.context.path}"
           war="file://${dist.file}"/>
</target>

<target name="install-local" depends="dist,startup-local">
   <install url="${local.manager.url}"
            username="${local.manager.username}"
            password="${local.manager.password}"
            path="${webapp.context.path}"
            war="file://${dist.file}"/>
</target>

As you can see, the two targets are exactly the same, they just use the 
deploy and install Ant tasks. The dist.file property is the war file the 
"dist" depends task put into the development dist directory before. From 
there the web app war is installed/deployed. The <startup-local> tasks 
ensures local Tomcat is running (to be able to use the Manager app).

To me the whole difference between the <install> and <deploy> is tasks 
is unclear - please enlighten me...

The only differences I can see are:

- the deploy task also copies the war file to the 
$CATALINA_HOME/work/standalone/localhost/manager directory and locks the 
file, so I can't delete it (e.g. with my Explorer)
- when using deploy, the web app is permanently remembered between 
server restarts

I find it pretty strange, not to find the web app war in the webapps 
dir, and the basketball dir, too. Is there anything that might be 
misconfigured? Though I did not edit any files or anything besides 
adding a user/pw combo with the manager role.

Should I simply accept it the way it is? What is going on behind the 
scenes? Are the Ant tasks responsible for this or Tomcat?

Karsten

Morgan Pyne wrote:

> When we use Ant to "deploy" via the manager, the WAR file gets uploaded to:
> 
> {TOMCAT_HOME}/work/_/{VIRTUAL_HOST_NAME}/tomcat4_manager/
> 
> By default, our Tomcat is set not to expand war files, so only the actual WAR 
> archive gets put in there.
> 
> Once we actually access the servlet, the files are extracted into:
> 
> {TOMCAT_HOME}/work/_/{VIRTUAL_HOST_NAME}/{SERVLET_CONTEXT}/
> 
> As was already pointed out, "deploying" and "installing" are different 
> operations and do different things, so if you clarify what you are doing 
> we might be able to help a little more.
> 
> Hope this is useful,
> Regards,
> Morgan
> 
> 
>>-----Original Message-----
>>From: Euan Guttridge [mailto:EGuttridge@buildonline.com] 
>>Sent: Wednesday, April 16, 2003 13:28
>>To: 'Tomcat Users List'
>>Subject: RE: Installs/deploys to... why?
>>
>>
>>In my (limited) experience of deploying with ant, the webapp 
>>gets deployed into the /work directory. Extract from Wrox 
>>"Professional Tomcat", p401:
>>
>>In reference to the ant deploy task:
>>--"Note that the WAR file did not get moved to the webapps 
>>directory. The WAR file in fact got copied to the 
>>$CATALINA_HOME/work/standalone/localhost/manager directory 
>>and then it was automatically expanded into the 
>>$CATALINA_HOME/work/standalone/localhost/wrox directory."--
>>
>>
>>
>>-----Original Message-----
>>From: Wendy Smoak [mailto:Wendy.Smoak@asu.edu] 
>>Sent: 16 April 2003 01:36
>>To: 'Tomcat Users List'
>>Subject: RE: Installs/deploys to... why?
>>
>>
>>Karsten wrote:
>>
>>>1. I'm using Ant to (deploy/)install my web app to a local 
>>>
>>Tomcat 4.1. 
>>
>>>Any time I do that, my web app gets installed in the context path 
>>>/basketball, which is right. The index.html is found, so 
>>>
>>the install 
>>
>>>seems to work. However, on the local server, when looking for the 
>>>files that have been installed, I don't get where the web 
>>>
>>application 
>>
>>>files actually are!
>>>
>>If you used 'install', the files are wherever you told ant 
>>they were, the files do not get moved.  Example:
>>
>><target name="install" depends="init" description="Install 
>>application to servlet container"> <install 
>>url="${manager.url}" username="${manager.username}" 
>>password="${manager.password}" path="/${context}" 
>>war="file://w:/java/bendev/webapp" /> 
>></target>
>>
>>And in w:/java/bendev/webapp is the normal directory 
>>structure you'd find for any webapp... some html files, a 
>>WEB-INF directory, etc.
>>
>>
>>>Anytime install or deploy succeeds, the directory called 
>>><tomcat-root>/work/Standalone/localhost/manager/basketball 
>>>
>>is created, 
>>
>>>however, *only* with the WEB-INF subdir recursively plus 
>>>
>>all the class 
>>
>>>files.
>>>
>>Mine (4.1.24) creates the same structure, but *only* the JSP 
>>source and .class files are there.  Look closely at the class 
>>names you find there, aren't they the JSP's and not your 
>>other .class files?
>>
>>I'm getting confused as to whether you're using 'install' or 
>>'deploy' and they are different, so I'll stop now before I 
>>get the rest of it wrong. ;)
>>
>>-- 
>>Wendy Smoak
>>Applications Systems Analyst, Sr.
>>Arizona State University PA Information Resources Management
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message