You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alice Young <al...@yahoo.com> on 2007/07/15 17:47:08 UTC

change in local directory deployment behavior between 5.5 and 6

Hi,
   
  I have been searching for a solution to this problem for a while, but it's difficult to search on when the keywords match so many general topics.
   
  In tomcat 5.5, I was able to use manager to deploy from a directory on the filesystem, and tomcat would use that directory for the source. It would not copy the contents of the directory to its webapps directory. I could stop tomcat, start it again and pick up changes in the class files of the app. This was very quick because no file copying was going on.
   
  In tomcat 6, it now copies all of the files to the webapps directory. I can no longer just stop and restart tomcat to pick up the changes in the class files because tomcat has its own copy. I have to undeploy and redeploy at minimum, and it takes quite some time and extra work on my part.
   
  Is there a way to configure tomcat 6 get the old tomcat 5.5 behavior back? Thanks for any help.
   
  Alice
   

       
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
 Play Sims Stories at Yahoo! Games. 

RE: change in local directory deployment behavior between 5.5 and 6

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alice Young [mailto:aliceyoung44@yahoo.com] 
> Subject: RE: change in local directory deployment behavior 
> between 5.5 and 6
> 
> I created /conf/Catalina/localhost (localhost on a 
> hunch) and put ROOT.xml in it:
>   <Context path="/" docBase="c:/the_app/WebRoot/">
> </Context>

You should take out the path attribute - it's not allowed in this
situation, although Tomcat usually ignores it when the <Context> is not
in server.xml.

 - 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: change in local directory deployment behavior between 5.5 and 6

Posted by Alice Young <al...@yahoo.com>.
Charles,
  THANK YOU!! This put me on the right track to the answer. I did see something very similar to what you were talking about in a document somewhere, but it wasn't especially clear. About 10 more minutes of tinkering with it and it worked! One thing that threw me off was the directories, which didn't exist yet. I created /conf/Catalina/localhost (localhost on a hunch) and put ROOT.xml in it:
   
  <Context path="/" docBase="c:/the_app/WebRoot/">
</Context>
   
  Then deleted the old ROOT dir under webapps that was copied in before, and restarted. Miraculously, it came right up without copying anything. This is exactly what I was looking for. Thanks!
  

"Caldarale, Charles R" <Ch...@unisys.com> wrote:
  > From: Alice Young [mailto:aliceyoung44@yahoo.com] 
> Subject: Re: change in local directory deployment behavior 
> between 5.5 and 6
>
> I've looked into it some more and it seems like I need to
> create a custom context.xml. However I can't seem to find
> much information on how to do this at all, in the tomcat
> docs or in the tomcat-related books that I have.

You certainly had one before, although it may have been created
automatically during the deployment. Whatever script you're using
should also have created it for Tomcat 6.

Most books have not caught up to Tomcat 5.5, let alone 6. In any event,
the doc is here:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

Basically, you need to create a file named ROOT.xml in
conf/Catalina/[host]; within that file you need to have a 
element with a docBase attribute pointing to the actual location of your
webapp (c:/myapp/WebRoot, apparently). You may need other attributes as
well; that depends on the webapp.

You must also delete Tomcat's regular webapps/ROOT directory and
everything in it.

- 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



       
---------------------------------
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. 

RE: change in local directory deployment behavior between 5.5 and 6

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alice Young [mailto:aliceyoung44@yahoo.com] 
> Subject: Re: change in local directory deployment behavior 
> between 5.5 and 6
>
> I've looked into it some more and it seems like I need to
> create a custom context.xml. However I can't seem to find
> much information on how to do this at all, in the tomcat
> docs or in the tomcat-related books that I have.

You certainly had one before, although it may have been created
automatically during the deployment.  Whatever script you're using
should also have created it for Tomcat 6.

Most books have not caught up to Tomcat 5.5, let alone 6.  In any event,
the doc is here:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

Basically, you need to create a file named ROOT.xml in
conf/Catalina/[host]; within that file you need to have a <Context>
element with a docBase attribute pointing to the actual location of your
webapp (c:/myapp/WebRoot, apparently).  You may need other attributes as
well; that depends on the webapp.

You must also delete Tomcat's regular webapps/ROOT directory and
everything in it.

 - 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: change in local directory deployment behavior between 5.5 and 6

Posted by Alice Young <al...@yahoo.com>.
Hi Johnny,
   
  Thanks for your response. Before you wrote this I tried downloading 5.5 and discovered that indeed there isn't any perceptable difference in the default behavior. This has me scratching my head because I don't know what I did to get what I had before. Unfortunately the hard drive where 5.5 resided died and during the recovery I didn't take the tomcat install, so I don't know how I had it configured.
   
  Basically, I had it so that when I started tomcat, it would automatically make a particular directory outside of tomcat's home dir the ROOT web app. Example:
   
  c:/myapp/WebRoot/WEB-INF
   
  So that the jsp files under WebRoot were at the root of the ROOT web application. I've looked into it some more and it seems like I need to create a custom context.xml. However I can't seem to find much information on how to do this at all, in the tomcat docs or in the tomcat-related books that I have. I certainly didn't do this before so I don't know how I managed to configure it this way.
   
  Do you have a suggestion on how to make this work? Ideally I want to start Tomcat 6 and have it immediately pick up the webapp as ROOT even though it's outside the directory, no copying or war-creating (since it's a big app with thousands of class files).
   
  Thanks for your help!
  Alice

Johnny Kewl <jo...@kewlstuff.co.za> wrote:
  
----- Original Message ----- 
From: "Alice Young" 
To: 
Sent: Sunday, July 15, 2007 5:47 PM
Subject: change in local directory deployment behavior between 5.5 and 6


> Hi,
>
> I have been searching for a solution to this problem for a while, but 
> it's difficult to search on when the keywords match so many general 
> topics.
>
> In tomcat 5.5, I was able to use manager to deploy from a directory on 
> the filesystem, and tomcat would use that directory for the source. It 
> would not copy the contents of the directory to its webapps directory. I 
> could stop tomcat, start it again and pick up changes in the class files 
> of the app. This was very quick because no file copying was going on.
>
> In tomcat 6, it now copies all of the files to the webapps directory. I 
> can no longer just stop and restart tomcat to pick up the changes in the 
> class files because tomcat has its own copy. I have to undeploy and 
> redeploy at minimum, and it takes quite some time and extra work on my 
> part.
>
> Is there a way to configure tomcat 6 get the old tomcat 5.5 behavior 
> back? Thanks for any help.
>
> Alice

Hi Alice.... how were you actually deploying it? Using an IDE, ant, HTTP?
It doesnt actually look like its changed much from 5.5 to 6... so it may 
just be the tool thats doing it different with TC6?

Anyway let me show you how I do it.... once you have this ant script setup, 
its so handy, you cant live without it.
It just so happens its actually setup now for what you need....
If my notes are not clear... the trick is just to setup the context.xml with 
its "own docBase location"... in the unpacked web app in one of your 
folders.
Then when you run this ant script... TC will use that unpacked webapp... 
just point config at the context in the webapp.

Have fun....












classpathref="deployer.classpath"/>


     change username and password to Tomcat Admin
     war - is the path to the thing you trying to install
     dont change update - it makes it undeploy existing first
     path - is the Context (the uri you want it to be)
     config - points via a context file that will be used as the docbase
      if you use config you dont use war or localWar
      ie it will point tc at the existing installation that you have at that 
docBase
      - ie context.xml looks like this -
        
        

     localWar - will move the contents of your unpacked web app to tc

     In Netbeans right click and run task 'deploy'

     If you dont like ant then this will also work
     http://localhost:8080/manager/deploy?config=file://D:\\GARBAGE\\TestSite\\META-INF\\context.xml&path=/Test88
  -->


     war="D:\\DEV\\PROJECTS\\TestRemoteIp\\dist\\TestRemoteIp.war"
     config="D:\\GARBAGE\\TestSite\\META-INF\\context.xml"
     localWar="file://D:\\GARBAGE\\TestSite"
  -->

path="/Test5"
update="true"
config="file://D:\\GARBAGE\\TestSite\\META-INF\\context.xml"
/>




       make a "lib" folder under the application folder
       add
        catalina-ant.jar
        catalina-deployer.jar
        el-api.jar
        jasper.jar
        jasper-el.jar
        jsp-api.jar
        servlet-api.jar
        tomcat-juli.jar

       They are all in your Tomcat Libs....
  -->



---------------------------------------------------------------------
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



       
---------------------------------
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.

Re: change in local directory deployment behavior between 5.5 and 6

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
----- Original Message ----- 
From: "Alice Young" <al...@yahoo.com>
To: <us...@tomcat.apache.org>
Sent: Sunday, July 15, 2007 5:47 PM
Subject: change in local directory deployment behavior between 5.5 and 6


> Hi,
>
>  I have been searching for a solution to this problem for a while, but 
> it's difficult to search on when the keywords match so many general 
> topics.
>
>  In tomcat 5.5, I was able to use manager to deploy from a directory on 
> the filesystem, and tomcat would use that directory for the source. It 
> would not copy the contents of the directory to its webapps directory. I 
> could stop tomcat, start it again and pick up changes in the class files 
> of the app. This was very quick because no file copying was going on.
>
>  In tomcat 6, it now copies all of the files to the webapps directory. I 
> can no longer just stop and restart tomcat to pick up the changes in the 
> class files because tomcat has its own copy. I have to undeploy and 
> redeploy at minimum, and it takes quite some time and extra work on my 
> part.
>
>  Is there a way to configure tomcat 6 get the old tomcat 5.5 behavior 
> back? Thanks for any help.
>
>  Alice

Hi Alice.... how were you actually deploying it? Using an IDE, ant, HTTP?
It doesnt actually look like its changed much from 5.5 to 6... so it may 
just be the tool thats doing it different with TC6?

Anyway let me show you how I do it.... once you have this ant script setup, 
its so handy, you cant live without it.
It just so happens its actually setup now for what you need....
If my notes are not clear... the trick is just to setup the context.xml with 
its "own docBase location"... in the unpacked web app in one of your 
folders.
Then when you run this ant script... TC will use that unpacked webapp... 
just point config at the context in the webapp.

Have fun....

<project name="Deployer" default="deploy" basedir=".">

  <path id="deployer.classpath">
    <fileset dir="${basedir}/lib">
      <include name="*.jar"/>
    </fileset>
  </path>

  <taskdef resource="org/apache/catalina/ant/catalina.tasks"
           classpathref="deployer.classpath"/>


  <!-- point url at manager
     change username and password to Tomcat Admin
     war - is the path to the thing you trying to install
     dont change update - it makes it undeploy existing first
     path - is the Context (the uri you want it to be)
     config - points via a context file that will be used as the docbase
      if you use config you dont use war or localWar
      ie it will point tc at the existing installation that you have at that 
docBase
      - ie context.xml looks like this -
        <?xml version="1.0" encoding="UTF-8"?>
        <Context docBase="D:\GARBAGE\TestSite" path="/Ignored"/>

     localWar - will move the contents of your unpacked web app to tc

     In Netbeans right click and run task 'deploy'

     If you dont like ant then this will also work
     http://localhost:8080/manager/deploy?config=file://D:\\GARBAGE\\TestSite\\META-INF\\context.xml&path=/Test88
  -->


  <!-- sample configs
     war="D:\\DEV\\PROJECTS\\TestRemoteIp\\dist\\TestRemoteIp.war"
     config="D:\\GARBAGE\\TestSite\\META-INF\\context.xml"
     localWar="file://D:\\GARBAGE\\TestSite"
  -->
  <target name="deploy" description="Deploy web application">
    <deploy url="http://localhost:8080/manager" username="admin" password=""
            path="/Test5"
            update="true"
            config="file://D:\\GARBAGE\\TestSite\\META-INF\\context.xml"
            />
  </target>

</project>
  <!-- MAKE a simple java application
       make a "lib" folder under the application folder
       add
        catalina-ant.jar
        catalina-deployer.jar
        el-api.jar
        jasper.jar
        jasper-el.jar
        jsp-api.jar
        servlet-api.jar
        tomcat-juli.jar

       They are all in your Tomcat Libs....
  -->



---------------------------------------------------------------------
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