Great, thanks David. Very useful macros. Cheers, Raju
On Sat, Jun 12, 2010 at 12:31 AM, David Nault <[email protected]> wrote: > Raju, > > Yes, these are macros I wrote for Webtop. I don't see a problem contributing > them to the platform. > > David > > On Jun 11, 2010, at 3:11 AM, Raju Bitter wrote: > >> Are you using that code for Webtop as well? I think I remember that I >> saw the copy effect for Tomcat within the Webtop SDK as well. But that >> was Webtop 1.5. >> >> On Fri, Jun 11, 2010 at 12:09 PM, Raju Bitter >> <[email protected]> wrote: >>> >>> Great, David, thanks! That works. Just one question: Is the Ant macro >>> file your own code? Could that be added to the platform? >>> >>> Now using this target >>> >>> <target name="webapp.deploy" depends="init" unless="no.tomcat" >>> description="Deploy lps webapp into tomcat5." > >>> <tomcatDeployInPlace contextPath="/${build.branch}" >>> docBase="${LPS_HOME}"/> >>> </target> >>> >>> I can deploy/undeploy in the old way with Tomcat 6.0. >>> >>> @Tucker >>> Should we add a switch to the Ant build file. If Tomcat 5.5+ is used, >>> the new macro should be used to deploy the app. >>> >>> On Fri, Jun 11, 2010 at 1:38 AM, David Nault <[email protected]> >>> wrote: >>>> >>>> Here are some ant macros that automatically create a context file for >>>> in-place deployment without the nasty side effects when the app is >>>> undeployed. >>>> >>>> <import file="tomcat-manager-ant-macros.xml"/> >>>> >>>> <tomcatDeployInPlace contextPath="/somecontext" >>>> docBase="/path/to/exploded/webapp"/> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Jun 10, 2010, at 2:45 PM, Raju Bitter wrote: >>>> >>>>> In the 5.0 docs I found regarding the undeploy command: >>>>> >>>>> "WARNING - This command will delete the contents of the web >>>>> application directory and/or ".war" file if it exists within the >>>>> appBase directory (typically "webapps") for this virtual host . The >>>>> web application temporary work directory is also deleted. If you >>>>> simply want to take an application out of service, you should use the >>>>> /stop command instead." >>>>> >>>>> That would make sense. If you deploy an app through the local file >>>>> system using a directory outside the appBase dir (normally >>>>> $TOMCAT_HOME/webapps), an undeploy command will delete the webapp >>>>> folder and the temp folder. >>>>> >>>>> Then I did some testing with Tomcat 6. If I use a context.xml file - >>>>> which I place in the $LPS_HOME folder - I can use the Tomcat manager >>>>> application to deploy and undeploy apps as we could with Tomcat 5.0. >>>>> >>>>> Here's the context.xml I'm using: >>>>> <Context path="/trunk" >>>>> docBase="/Users/rajubitter/src/svn/openlaszlo/trunk-work/" >>>>> debug="0"> >>>>> </Context> >>>>> >>>>> I have that in my OL trunk folder: >>>>> /Users/rajubitter/src/svn/openlaszlo/trunk-work >>>>> >>>>> In the Tomcat manager, I deploy a new webapp, using "/trunk" for the >>>>> field "Context Path (required):". >>>>> For the field "XML Configuration file URL:" I use >>>>> "/Users/rajubitter/src/svn/openlaszlo/trunk-work/context.xml" >>>>> >>>>> When I undeploy the app, the directory is not deleted. Unfortunately, >>>>> using the ANT script with an additional attribute >>>>> config="${LPS_HOME}/context.xml" >>>>> the directory content is still copied into the webapps folder. Here's >>>>> the full XML for the ANT task I tested: >>>>> <deploy url="${tom.url}" >>>>> username="${tom.username}" >>>>> password="${tom.password}" >>>>> path="/${build.branch}" >>>>> localWar="${LPS_HOME}" >>>>> config="${LPS_HOME}/context.xml" >>>>> /> >>>>> >>>>> But at least you could quickly redeploy the webapp by using the URL >>>>> http://localhost:8080/manager/html/reload?path=/trunk, if you have >>>>> authenticated with Tomcat manager app. >>>>> >>>>> >>>>> On Thu, Jun 10, 2010 at 11:10 PM, Raju Bitter >>>>> <[email protected]> wrote: >>>>>> >>>>>> You could try to use web app stop and start tasks instead of redeploy. >>>>>> >>>>>> <target name="start" >>>>>> description="start application on servlet container"> >>>>>> <echo message="app path: ${app.path}"/> >>>>>> <start >>>>>> url="${catalina.manager.url}" >>>>>> username="${catalina.manager.username}" >>>>>> password="${catalina.manager.password}" >>>>>> path="${app.path}"/> >>>>>> </target> >>>>>> <target name="stop" >>>>>> description="Stop application on servlet container"> >>>>>> <echo message="app path: ${app.path}"/> >>>>>> <stop >>>>>> url="${catalina.manager.url}" >>>>>> username="${catalina.manager.username}" >>>>>> password="${catalina.manager.password}" >>>>>> path="${app.path}"/> >>>>>> </target> >>>>>> >>>>>> On Thu, Jun 10, 2010 at 11:00 PM, Raju Bitter >>>>>> <[email protected]> wrote: >>>>>>> >>>>>>> It should be in /tomcat/conf/Catalina/localhost >>>>>>> In my case, I have a version of trunk deployed using the path >>>>>>> /trunk-work, and here's the corresponding XML file's content: >>>>>>> <?xml version='1.0' encoding='utf-8'?> >>>>>>> <Context docBase="/Users/rajubitter/src/svn/openlaszlo/trunk-work" >>>>>>> path="/trunk-work"> >>>>>>> </Context> >>>>>>> The name of the generated file will be the same as the path you have >>>>>>> chosen for the app. >>>>>>> On Thu, Jun 10, 2010 at 10:55 PM, P T Withington <[email protected]> >>>>>>> wrote: >>>>>>>> >>>>>>>> It looks like they must be. That's probably what's taking all the >>>>>>>> tiem. >>>>>>>> >>>>>>>> Where is this context descriptor file of which you speak? >>>>>>>> >>>>>>>> I am a tomcat dummy. >>>>>>>> >>>>>>>> On 2010-06-10, at 16:43, Raju Bitter wrote: >>>>>>>> >>>>>>>>> Tucker, when you deploy the app, is the content being copied into >>>>>>>>> Tomcat >>>>>>>>> webapps folder? What is the content of the context descriptor file >>>>>>>>> generated? >>>>>>>>> >>>>>>>>> On Thu, Jun 10, 2010 at 10:32 PM, Raju Bitter < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> I had some problems when I used Java 6 with the error message >>>>>>>>>> javax >>>>>>>>>> not >>>>>>>>>> found, or something similar. That's the only thing I can remember, >>>>>>>>>> Henry. >>>>>>>>>> >>>>>>>>>> Could it be an error with the docbase setting for the context? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Thu, Jun 10, 2010 at 9:46 PM, Henry Minsky >>>>>>>>>> <[email protected]>wrote: >>>>>>>>>> >>>>>>>>>>> Wasn't Raju complaining at one point about a newer version of >>>>>>>>>>> tomcat >>>>>>>>>>> copying all the files from the working dir into it's own dir >>>>>>>>>>> instead >>>>>>>>>>> ofjust >>>>>>>>>>> running from the directory? Raju? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Thu, Jun 10, 2010 at 3:40 PM, P T Withington <[email protected]> >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> And now webapp.deploy seems to take forever (1:43) and if emacs >>>>>>>>>>>> has >>>>>>>>>>>> left >>>>>>>>>>>> any .# temp files in WEB-INF tomcat silently declines to deploy >>>>>>>>>>>> my >>>>>>>>>>>> servlet >>>>>>>>>>>> (I guess) and serves up all my .lzx files as straight text. >>>>>>>>>>>> >>>>>>>>>>>> Looking for suggestions... >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>>> Henry Minsky >>>>>>>>>>> Software Architect >>>>>>>>>>> [email protected] >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>> > >
