Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Redeploy application

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,


Whenever i want to deploy new version of application (that's VERY often), have to:
stop tomcat;
execute build.xml -ant script;
start tomcat;

Is there any way, target in ant, that can make this easier?


Regards





 
JavaMonitor Support
Posts: 251
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Imre,

How about this: don't restart Tomcat, but copy the war into the webapps directory. Tomcat will hot-deploy the app, saving precious seconds.

Also: check your webapp startup sequence and reduce the amount of startup work. Tomcat starts in a second or two on my laptop, so you're not waiting for Tomcat to start, but for your own webapp. :-)
 
Marshal
Posts: 67415
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat Manager application can start and stop individual applications without the need to start and stop Tomcat.
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is what i need, but when:


1.) Only overwrite appname.war or erase appname.war and copy new appname.war on {tomcat.home}/webapps
Undeploying context [/appname]
Deploying web application archive appname.war

and when i want to access to webapp via browser i get
http status 404 requested source is not available



2.) Want to erase {tomcat.home}/webapps/appname folder and {tomcat.home}/webapps/appname.war

build.xml:63: Unable to delete file D:\apache-tomcat-5.5.26\webapps\tracking\WEB-INF\lib\formdef_1_0-validator_1_2_0.jar

When i copy necessary jars to {tomcat.home}/common/lib or {tomcat.home}/server/lib and remove them from my webapp, i get error ClassLoaderError...

I'm developing a Struts framework based application.


How to solve this? Any similar experience?


Regards
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your answer, Misha!


BUT i get:
BUILD FAILED
E:\AppName\build.xml:87: Problem: failed to create task or type deploy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.



Any more hints?


Best Regards
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely you are missing catalina-ant.jar
 
Imre Tokai
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added this to META-INF/context.xml:

<Context reloadable="true" antiResourceLocking="true">
( former: <Context> )

just overwrite webapps/appname.war and it seems to work!


Any experiences with this approach?


Regards
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic