简体   繁体   English

生成一次生成的Java Web项目时出错?

[英]Error when building once built java web project?

When I run for the first time there doesn't show any errors and I did double check the code and there is no error, but once again when I build the file again the following error pops up. 当我第一次运行时,没有显示任何错误,并且我仔细检查了代码,也没有错误,但是当我再次构建文件时,再次弹出以下错误。

Deleting directory C:\Users\Vbabey\Documents\NetBeansProjects\PersistenceMYEX2\build C:\Users\Vbabey\Documents\NetBeansProjects\PersistenceMYEX2\nbproject\build-impl.xml:1054: Unable to delete file C:\Users\Vbabey\Documents\NetBeansProjects\PersistenceMYEX2\build\web\WEB-INF\lib\toplink-essentials-agent.jar

I cannot understand the reason for the above error? 我不明白上述错误的原因? Can anybody explain me what it is? 谁能解释我的意思?

Based on your comments, you are running into the default windows locking behavior. 根据您的评论,您将遇到默认的Windows锁定行为。 If you have a jar file open to run an application, you can't overwrite it. 如果您打开了一个jar文件来运行应用程序,则无法覆盖它。

You might be building it when the server is on. 服务器打开时,您可能正在构建它。 Some other application is using your files. 其他一些应用程序正在使用您的文件。 Try switching off the server or other applications that may be using the files. 尝试关闭可能正在使用这些文件的服务器或其他应用程序。

A quick fix can be to export the project and import it with a different name and then you can build it. 一个快速的解决方案是导出项目并使用其他名称导入它,然后您可以构建它。

  1. Simply stop the tomcat or kill the java.exe process before building again. 只需停止tomcat或终止java.exe进程,然后再进行构建即可。

  2. Secondly, I believe you're using Clean & Build option, which does create issue, when the project is already running. 其次,我相信您正在使用“清理并构建”选项,当项目已经在运行时,它确实会产生问题。 Instead just use the build option or run option in case you want to run. 相反,如果要运行,只需使用build选项或run选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM