13

I am trying to run an web app. In the beginning it was going well, but I had to delete some jars from the project folder. I didn't delete the jars using eclipse. So, I started to get these errors:

Publishing failed with multiple errors
Could not delete C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/fj21-tarefas/WEB-INF/lib. May be locked by another process.
Could not delete C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/fj21-tarefas/WEB-INF. May be locked by another process.

I tried to delete my whole project and code it again. But it doesn't work. I also deleted the Tomcat server but again it doesn't work. Then I realized that to "fix" this problem I have to delete this folder:

C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/fj21-tarefas/WEB-INF.

And clean the server and the project. But when I close eclipse and open again I get the same error, then I have to do this process.

Anyone here knows how to fix this kind of tomcat bug?

mavis
  • 3,100
  • 3
  • 24
  • 32
Murilo
  • 4,453
  • 5
  • 19
  • 28

15 Answers15

18

Simply delete the server and then add it again,then restart your eclipse.It worked for me.

vikash mudliar
  • 181
  • 1
  • 3
9

Close the eclipse and go to below location(depends on your system locaiton)

C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/

and delete tmp0 directory now start eclipse and it will work fine.

Sachin Kumar
  • 91
  • 1
  • 4
2

i don know the exact reason for this problem but i was clear the same issue by restarting my system. so restart your system once, it may gives solution for your problem.

Abhi Urs
  • 95
  • 3
  • 8
1

there is already a post which answer this question you need to:

  1. Clean Server
  2. Clean Tomcat Work Directory

link to the page: Why is my publishing failing in Tomcat v7.0 Server because of locks by another process?

Greko2015 GuFn
  • 512
  • 6
  • 13
  • here is the link: https://stackoverflow.com/questions/9632880/why-is-my-publishing-failing-in-tomcat-v7-0-server-because-of-locks-by-another-p It was there already – Greko2015 GuFn Jan 02 '18 at 07:39
1

Go to the servers tab-> click on the dropdown menu.It contains all the projects related to that server Now simply right click on the project name you don't want to run right now and select remove

Why So Serious
  • 129
  • 1
  • 9
1

When you have multiple projects in the workspace, the run button will record the run history, so you should press the triangle button to select the correct run option. For example, when I choose to run "AjaxAdms" directly, an error will be reported, but if I choose to "run tomcat on the localhost" option, no error will be reported.enter image description here Also, as shown in Figure 2 and 3, you should remove unnecessary projects from the Tomcat server.enter image description hereenter image description here

mc_wendy
  • 43
  • 5
0

It may be because you are using C driver and you may need Administration rights to perform operation on this directory, try after change the C drive, in any other drive like D: or E:

Shams
  • 3,637
  • 5
  • 31
  • 49
0

Some of your jars are still loaded into memory, therefor their parent directories cannot be deleted. Check if there are running processes accessing any jars or restart Eclipse.

Stefan
  • 12,108
  • 5
  • 47
  • 66
0

Eclipse Juno running Tomcat 7 on Win7; kept getting the publish error on a javascript file. Tried renaming the file but that did not work.

I deleted my existing Tomcat server, as recommended by Vikash Mudliar, and added a new server instance. That worked and I was able to publish successfully.

SwadeWorx
  • 41
  • 5
0

In my case this happens only when I trigger Update Maven Project (ALT+F5) in Eclipse and the server instance is running with my app attached.

So You have to remove the app from the server ,turn of the server and the n do the Update Maven Project . If the problem persists Clean helps

Igor Vuković
  • 742
  • 12
  • 25
0

If you close a project and it still in Apache Tomcat resources this issue occurs.

Hayi
  • 6,972
  • 26
  • 80
  • 139
0

Faced this issue after adding a new dependency to pom,

SOLUTION:

Add maven dependencies to 'deployment assembly'. To do that
right click on the project > Build Path > Configure Build Path > Deployment Assembly > Add > Java Build Path Entries > Maven Dependencies
Tadele Ayelegn
  • 4,126
  • 1
  • 35
  • 30
0

For my issue I just had a process that was hung.

On Windows, open the Task Manager and shut down your hung Java process. On linux run: ps -ef | grep tomcat, then kill the hung process.

Boo
  • 377
  • 6
  • 18
0

I had this issue too.

I tried to clean the server, delete server and reinstall it, delete the tmp0 folder. I tried even to copy and paste same project and change other settings. Nothing really worked for me.

The only thing that worked for me, was to create a new project and copy all the files from the broken project to the new one. My solution also fixed this issue too.

0

Delete the Tomcat server and reconfigure it, It works fine

Srinivas_N
  • 53
  • 1
  • 10