28

I have a Tomcat v7.0 server setup in my eclipse (helios) environment which I use for testing web applications. Currently I have in my workspace a struts web-app which is loaded correctly into the server, along with two ther dynamic web projects which im trying to upload. Mainly, a simple class which i want to turn into a web service for axis2 for the first project and a simple html page (made for testing this issue) for the second one.

However, neither one are loading correctly inside the server and I'm seeing locks by another process errors.

The error given by the server console is:

    Publishing failed with multiple errors
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\activation-1.1.jar. May be locked by another process.

Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\antlr-2.7.7.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axiom-api-1.2.11.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axiom-dom-1.2.11.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axiom-impl-1.2.11.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-adb-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-adb-codegen-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-ant-plugin-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-clustering-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-codegen-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-corba-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-fastinfoset-1.6.0.jar. May be locked by another process.
 Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-java2wsdl-1.6.0.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-jaxbri-1.6.0.jar. May be locked by another process.

...etc

Has someone already encountered this issue and knows of a solution?

James Drinkard
  • 15,342
  • 16
  • 114
  • 137
Th0rndike
  • 3,406
  • 3
  • 22
  • 42
  • You could investigate which process is locking these files and dig deeper from there. On windows, I use unlocker (http://www.filehippo.com/download_unlocker/) – Enno Shioji Mar 09 '12 at 11:45
  • yeah i thought about that but i didn't know about that tool you suggested. Anyway, restarting solved the issue (obviously). Not the REAL issue, but that's another story... :) – Th0rndike Mar 09 '12 at 13:11
  • 1
    I've got the same issue. Have you found a solution yet? – Bob Mar 15 '12 at 21:30
  • i'll be posting the answer in the next couple of hours – Th0rndike Mar 16 '12 at 08:06

9 Answers9

50

1- Stop the Server
2- Clean the Server
3- Clean Tomcat Work Directory ... enter image description here

Usman
  • 1,116
  • 11
  • 13
  • Before doing these steps I also had to "clean Module Work Directory" from the module which was causing the errors. Using Tomcat v8.0 and Eclipse 4.5.1 – JeffryHouser May 06 '16 at 15:24
  • This solution did not solve my problem, but I activated the automatic refresh option (window -> preferences -> workspace) and solved my problem – PurpleSoft Apr 25 '17 at 07:14
10
  1. In the console window, where you find the stack trace, just switch the tab from console to servers (or display it from Window -> Show View -> Servers).
  2. Double-click on your tomcat server, it will open up an overview of tomcat. You will find two tabs(on the bottom of the window). Overview and Modules.
  3. Click on Modules. You will find the projects listed there.
  4. Remove all of the projects and clean the server (right click on server's name -> Clean).

Try restarting the server and it will start working, as it worked for me.

Aleksandar
  • 3,558
  • 1
  • 39
  • 42
sunny
  • 121
  • 1
  • 2
7

I had totally forgotten about this question. Actually, the problem was elsewhere, to solve the "lock" problem all i had to do was restart the computer. Then i had other problems, but that doesn't concern this question.

Th0rndike
  • 3,406
  • 3
  • 22
  • 42
3

I had the same issue. I solved it by doing a clean on the server several times. Every time I was doing the clean, different libraries were locked, until finally all were unlocked. I hope it helps!

Techky
  • 431
  • 4
  • 10
1

I faced the same problem; removing the modules from the TomCat server solved the problem

1

The reason behind this issue is currently tomcat server directory is open and locked by another process. So use below steps to resolve this issue-

  1. Close the tomcat server deployment directory
  2. Right click on server--> Clean tomcat work directory
  3. Right click on server--> clean and restart the server.
Sai prateek
  • 11,842
  • 9
  • 51
  • 66
0

I have solved the problem according to the blow steps:

  1. Right click on your project
  2. Select Properties -> Deployment Assembly
  3. Click the button Add, select Java Build Path Entries, and click the button Next
  4. Select Maven Dependencies, finally click Finish.
0

I have encountered the same problem. You are not required to do something extra ordinary. Two solution might be helpful.

1) Restart your IDE (i.e. eclipse). (This might help you because in my case it did)

2) Restart your computer. This will help you to unlock the lock beyond any doubt.

Note: Cleaning Tomcat Work Directory may not help in your case.

-1

I have resolved the problem.

I have developed Spring Boot application with Apache Tomcate 9.0 server. This application ran successfully without any error till today, but suddendly I got an error like

could not delete.jars may be locked by othors

I have done two mistakes.

  1. I have changed my password today due to expired, but forgot to change my password in .m2/setting.xml. So I corrected this.

  2. I have deleted below dependency from pom.xml:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    
Ralf
  • 16,086
  • 4
  • 44
  • 68