This looks like the same bug indeed. The problem is it's random, can't be reproduced. So it's very hard to understand why deployment is failing.
This happens on resource changes, not pom.xml/dependency changes? Are you using the overlay feature?
If you know a way to reproduce the bug reliably, please let me know.
First of all, thanks a lot for your continued support, we really appreciate you work.
This happens on code changes to the web project, as well as code changes to dependencies.
We are not using the overlay feature.
I will let you know of any findings.
Hereby I attach a zip file containing a web project and a jar project dependency.
To reproduce on a tomcat 6 server and Indigo:
1. Deploy the web project to tomcat 6
2. Run tomcat in debug mode
3. While tomcat is in debug mode, add an empty method to TestJar on test-jar project, say test4() method and save.
4. Restart tomcat in debug (restart, not stop-start).
I then get the error popup:
Publishing failed with multiple errors
Could not delete C:/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/test-web/WEB-INF/lib. May be locked by another process.
Could not delete C:/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/test-web/WEB-INF. May be locked by another process.
Now, if I look into C:\Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\test-web\WEB-INF, there is no classes directory, and the lib directory is empty.
Now kill tomcat, and right-click on it and choose 'clean'. Everything is back to normal.
reproduce.zip 14.2 KB
Have you tried the same thing using stock WTP projects? See if it's a WTP problem or caused by m2e-wtp
I have tried it now without the maven Nature, with the same project hierarchy, and the same log4j dependency, the problem doesn't exist in this case.
Interesting to note, that in the M2E environment, if I remove the log4j dependency from the test-jar project, the problem is gone.
My guts tell me WTP doesn't handle proper dependency (re)deployment from a classpath library (The maven one in this case).
m2e-wtp doesn't do anything with regard to deployment, that's pure WTP's magic.
There's probably a way to reproduce the problem using maven-less projects but that probably requires some more head scratching.
Was the error popup a symptom in your initial observations (missing jars)?
Anyway can you please open a bug for the jar locking issue during redeployment at https://issues.sonatype.org/browse/MECLIPSEWTP?
I'll follow up with the WTP team when I can investigate.