Java 无法删除 /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/appname/WEB-INF/lib。可能被另一个进程锁定
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21112703/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not delete /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/appname/WEB-INF/lib. May be locked by another process
提问by Murilo
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:
我正在尝试运行一个网络应用程序。一开始一切顺利,但我不得不从项目文件夹中删除一些 jars。我没有使用 eclipse 删除罐子。所以,我开始收到这些错误:
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:
我试图删除我的整个项目并重新编码。但它不起作用。我也删除了 Tomcat 服务器,但它再次不起作用。然后我意识到要“修复”这个问题,我必须删除这个文件夹:
C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/fj21-tarefas/WEB-INF.
C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/fj21-tarefas/WEB-INF。
And cleanthe server and the project. But when I close eclipse and open again I get the same error, then I have to do this process.
并清理服务器和项目。但是当我关闭 eclipse 并再次打开时,我得到同样的错误,然后我必须执行此过程。
Anyone here knows how to fix this kind of tomcat bug?
这里有人知道如何修复这种tomcat错误吗?
回答by Abhi Urs
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.
我不知道这个问题的确切原因,但我通过重新启动系统清除了同样的问题。所以重新启动您的系统一次,它可能会为您的问题提供解决方案。
回答by Shams
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:
可能是因为您使用的是 C 驱动程序,您可能需要管理权限才能对该目录进行操作,请在更改 C 驱动器后尝试在任何其他驱动器中,例如 D: 或 E:
回答by Stefan
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.
你的一些 jars 仍然加载到内存中,因此无法删除它们的父目录。检查是否有正在运行的进程访问任何 jar 或重新启动 Eclipse。
回答by vikash mudliar
Simply delete the server and then add it again,then restart your eclipse.It worked for me.
只需删除服务器,然后再次添加,然后重新启动您的 eclipse。它对我有用。
回答by SwadeWorx
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.
Eclipse Juno 在 Win7 上运行 Tomcat 7;一直在 javascript 文件上收到发布错误。尝试重命名文件,但没有奏效。
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.
我按照 Vikash Mudliar 的建议删除了现有的 Tomcat 服务器,并添加了一个新的服务器实例。那行得通,我能够成功发布。
回答by Sachin Kumar
Close the eclipse and go to below location(depends on your system locaiton)
关闭 eclipse 并转到以下位置(取决于您的系统位置)
C:/Users/maniceto/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/
and delete tmp0
directory now start eclipse and it will work fine.
并删除tmp0
目录现在启动eclipse,它会正常工作。
回答by Igor Vukovi?
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.
在我的情况下,只有当我在 Eclipse 中触发更新 Maven 项目 (ALT+F5) 并且服务器实例正在运行我的应用程序时才会发生这种情况。
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
所以你必须从服务器上删除应用程序,关闭服务器,然后执行更新 Maven 项目。如果问题仍然存在 清洁有帮助
回答by Youssef
If you close a project and it still in Apache Tomcat resources this issue occurs.
如果您关闭一个项目并且它仍在 Apache Tomcat 资源中,则会出现此问题。
回答by Greko2015 GuFn
there is already a post which answer this question you need to:
已经有一个帖子可以回答你需要的这个问题:
- Clean Server
- Clean Tomcat Work Directory
- 清洁服务器
- 清理 Tomcat 工作目录
link to the page: Why is my publishing failing in Tomcat v7.0 Server because of locks by another process?
回答by Tadele Ayelegn
Faced this issue after adding a new dependency to pom,
在向 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