Ant 复制任务:由于 java.io.FileNotFoundException 导致复制失败

发布于 2024-08-04 00:34:22 字数 626 浏览 5 评论 0原文

我正在尝试在 Ant 中编译 Flex 应用程序(这里没有问题,我可以做得很好)。当我尝试将项目内容发布到 Windows 网络驱动器(在我的系统上称为“Z:\”)时,我收到 Java/Ant 抛出的以下 LAME 异常

BUILD FAILED
C:\workspace\bkeller\build.xml:42: Failed to copy C:\workspace\bkeller\web\assets\text\biography.html to Z:\web\bkeller\assets\text\biography.html due to java.io.FileNotFoundException Z:\web\bkeller\assets\text\biography.html (The system cannot find the file specified)

:糟透了。我找不到任何方法来解决这个问题,并且让这个问题正常工作对我的项目来说非常重要。我确信我对网络驱动器具有读/写/执行权限,我可以通过 Windows 资源管理器在驱动器上创建/编辑/删除文件。

Drive Z 是虚拟机的网络安装,允许我访问我的主机操作系统 Ubuntu。我已经仔细检查过它是否具有写入权限。有什么想法吗?

I'm trying to compile a Flex application in Ant (no problems here, I can do it fine). When I try to publish the contents of the project to a Windows network drive (known as "Z:\" on my system), I get the following LAME exception thrown by Java/Ant:

BUILD FAILED
C:\workspace\bkeller\build.xml:42: Failed to copy C:\workspace\bkeller\web\assets\text\biography.html to Z:\web\bkeller\assets\text\biography.html due to java.io.FileNotFoundException Z:\web\bkeller\assets\text\biography.html (The system cannot find the file specified)

Which kind of sucks. I can't find any way to get rid of this problem and it's pretty crucial to my project that I get this working. I know for sure that I have read/write/execute permissions on the network drive, I can create/edit/delete files on the drive just fine through Windows explorer.

Drive Z is a network mount to virtualbox, allowing me to get access to my host OS, Ubuntu. I've double checked that it has write permissions. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

寻梦旅人 2024-08-11 00:34:22

鉴于 Z 是一个网络安装,通过 Windows 资源管理器验证它是否工作(例如,您可以创建/写入文件)可能与在 Ant 中验证它是否工作不同:

  1. 您可能已经指定了必要的用户/密码过去的某个时候,资源管理器记得它(所以它不会再问你)。蚂蚁显然不会。
  2. Ant 可能会以不同的用户身份运行,特别是当您在构建中生成另一个进程时。

你能用java编写一个简单的测试,看看它是否可以在你的Z:驱动器上创建一个文件吗?也许这会提供一些见解。您还可以使用 -debug 开关运行 ant,看看它是否提供了更详细的信息。至少它会打印堆栈跟踪,您可以下载 Ant 源代码并查看发生了什么。

Seeing as how Z is a network mount, verifying that it works (e.g. that you can create / write files) through Windows Explorer may not be the same thing as verifying that it works from within Ant:

  1. You may have specified the necessary user / password sometime in the past and Explorer remembered it (so it doesn't ask you again). Ant obviously wouldn't.
  2. Ant may run as a different user, especially if you spawn another process inside the build.

Can you write a simple test in java and see if it can create a file on your Z: drive? Perhaps that'll provide some insight. You can also run ant with -debug switch and see if it provides a more detailed info. At the very least it would print a stack trace and you can download Ant source and see what's happening.

半暖夏伤 2024-08-11 00:34:22

刚刚经历了同样的问题。复制目标是连接到我的 Windows 7 计算机的常规网络驱动器。

我通过重新启动 Eclipse 解决了这个问题。

原因可能是 Eclipse 以管理员权限运行,因为我之前执行了 Eclipse 更新。

Just experienced the same problem. The copy target was a regular network drive connected to my Windows 7 machine.

I was able to solve the problem by restarting Eclipse.

The cause might have been that Eclipse was running with Administrator privileges because of an Eclipse update I had been performing beforehand.

荒芜了季节 2024-08-11 00:34:22

不用说该文件确实存在吗?无论如何,虽然可能拥有权限,但实际运行 ant 任务的进程是否拥有权限?

Does it go without saying that the file actually exists? Regardless, while you may have permission, does the process that is actually running the ant task have permission?

遗失的美好 2024-08-11 00:34:22

你当然想过,但你尝试过吗?

Z:/web/bkeller/assets/text/biography.html

即使在 Windows 上,我也总是使用 / 而不是 \,并且不记得复制目标有问题。

you certainly thought about it, but have you tried

Z:/web/bkeller/assets/text/biography.html

I always use the / instead of \ even on Windows and can't remember having a problem with the Copy target.

┼── 2024-08-11 00:34:22

这是 VirtualBox 的共享文件夹系统的问题。它在几个版本前被 3.0.X 修复。

It was a problem in VirtualBox's shared folder system. It was fixed a few releases ago by 3.0.X.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文