Tomcat 5.5: .jar is not exempt from .war rebuild

Description

I try to export the WAR to my webapps folder, but every time I update the war, it deletes the entire contents of the webapp minus / WEB -INF / lib / struts.jar

System Information

  • Windows 2K3
  • Tomcat 5.5
  • JRE 1.6.23

Ok, here's what happens:

  • Export a project as .WAR through the Eclipse directory (Helios) to the / webapps directory
  • Tomcat sees changes in war and tries to rebuild webapp
  • Tomcat deletes the contents of the webapp folder (/ webapps / public)
  • (/webapps/public/WEB-INF/lib/struts.jar) is blocked to prevent it from being deleted.
  • Tomcat refuses to restore, leaving me with nothing in the folder except struts.jar, which is why the application is interrupted.

Question (s)

  • Is there a way to block the bank?
  • (OR) the best deployment process I should use (and can quickly pick up)?

Using antiResourceLocking="true" and antiJARLocking="true" in the <Context> element did not solve the problem. Appreciate any help.

+6
source share
4 answers

Does unloadDelay to your context help?

What:

The number of ms that the container will wait while servlets are unloaded. If not specified, the default value for the flag is 2000 ms.

Source: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Apparently, sometimes a web application in the middle of a large GC / ClassLoader does not collect garbage and cannot release it in a timely manner. Try experimenting with a timeout to see if this helps.

There is also some anonymous evidence of strange file locking on Windows platforms.

Also, assuming you are referring to a development build environment (not production), consider one of my questions, showing my approach to hot Tomcat / Eclipse deployments:

Introducing Tomcat and Eclipse Zero Turnaround


Update

This useful thread appears in a Google search for the same issue and is mentioned by a number of others:

http://blog.exis.com/colin/?s=I+Put+A+Spell+On+You

+4
source

I assume your requirement is a quick deployment and rebuild, since eclipse is the ur IDE. Since you found out that exporting a war file to the webapps folder is not the best option. A few other options:

a) Using sysdeo tomcat plugin - sysdeo deploys the project folder

b) Update the script construct for deployment in a parsed format. - Expand the \ build folder as a sub-application

The first option is the easiest. The second option is cleaner.

[OFF TOPIC] consider switching to tomcat 7

+1
source

Could this thread be relevant? Quotes a DTD in the tiles-config.xml file, causing problems.

+1
source

This is probably not the best solution, but so far I have had similar problems with Tomcat 6. At the time I used Ant, so I wrote an Ant script that will be locally localized in Tomcat, in which case it will stop / will launch Tomcat where necessary (Tomcat was deployed as a service so I can use the NET STOP / NET START Commands ). This included deleting the old extended WAR folder.

I think there are probably better options, but it worked for me.

0
source

Source: https://habr.com/ru/post/887376/


All Articles