[英]Tomcat 5.5: .jar not releasing on .war rebuild
I am attempting to export a WAR to my webapps folder but everytiime I update the war it deletes all of the content of the webapp minus /WEB-INF/lib/struts.jar我正在尝试将 WAR 导出到我的 webapps 文件夹,但每次我更新 war 它都会删除 webapp 减去 /WEB-INF/lib/struts.jar 的所有内容
Using antiResourceLocking="true"
and antiJARLocking="true"
on the <Context>
element did not solve the problem.在<Context>
元素上使用antiResourceLocking="true"
和antiJARLocking="true"
并没有解决问题。 Appreciate any help.感谢任何帮助。
Does adding unloadDelay
to your Context help?将unloadDelay
添加到您的 Context 有帮助吗?
Which is the:哪一个是:
Amount of ms that the container will wait for servlets to unload.容器等待 servlets 卸载的毫秒数。 If not specified, the default value of the flag is 2000 ms.如果未指定,则标志的默认值为 2000 毫秒。
Source: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html来源: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
Apparently sometimes the web app is in the middle of a large GC / the ClassLoader hasn't been garbage collected and cannot release in time.显然有时 web 应用程序处于大型 GC 中间/ClassLoader 没有被垃圾收集并且无法及时释放。 Try experimenting with the timeout to see if that helps.尝试尝试超时,看看是否有帮助。
There is also some anecdotal evidence of strange file locking on Windows platforms.在 Windows 平台上还有一些奇怪的文件锁定的轶事证据。
Also, assuming you're referring to a development (not production) build environment, look at one of my questions, showing my approach to Tomcat / Eclipse hot deploy environments:此外,假设您指的是开发(而非生产)构建环境,请查看我的一个问题,展示我对 Tomcat / Eclipse 热部署环境的方法:
Tomcat and Eclipse Zero Turnaround Deployment Tomcat 和 Eclipse 零周转部署
Update更新
This helpful thread comes up on a Google search of the same issue and is referred to by a number of others:这个有用的线程出现在对同一问题的 Google 搜索中,并被许多其他人引用:
http://blog.exis.com/colin/?s=I+Put+A+Spell+On+You http://blog.exis.com/colin/?s=I+Put+A+Spell+On+You
I guess your requirement is to deploy and rebuild quickly given eclipse is ur IDE.我想您的要求是快速部署和重建,因为 eclipse 是您的 IDE。 As you have figured out exporting war file to webapps folder is not the best option.正如您已经发现将战争文件导出到 webapps 文件夹不是最好的选择。 Few other options are其他选项很少
a) Use sysdeo tomcat plugin -- sysdeo deploys the project folder a) 使用 sysdeo tomcat 插件 -- sysdeo 部署项目文件夹
b) Update build script to deploy in exploded format. b) 更新构建脚本以展开格式部署。 -- deploy the \build folder as exploded application -- 将 \build 文件夹部署为展开的应用程序
First option is easiest.第一个选项是最简单的。 Second option is cleaner.第二种选择更清洁。
[OFF TOPIC] consider switching to tomcat 7 [OFF TOPIC] 考虑切换到 tomcat 7
This is probably not the optimal solution but I have had similar issues with Tomcat 6 before now.这可能不是最佳解决方案,但在此之前我遇到过与 Tomcat 6 类似的问题。 At the time I was using Ant, so I wrote an Ant script which would deploy to Tomcat locally and in the process it would stop / start Tomcat where necessary (Tomcat was deployed as a service so I could use NET STOP / NET START commands ). At the time I was using Ant, so I wrote an Ant script which would deploy to Tomcat locally and in the process it would stop / start Tomcat where necessary (Tomcat was deployed as a service so I could use NET STOP / NET START commands ) . This included deleting the old expanded WAR folder.这包括删除旧的扩展 WAR 文件夹。
I think there probably are better options, but this worked for me.我认为可能有更好的选择,但这对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.