Ant 复制任务:由于 java.io.FileNotFoundException 导致复制失败
我正在尝试在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
鉴于 Z 是一个网络安装,通过 Windows 资源管理器验证它是否工作(例如,您可以创建/写入文件)可能与在 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:
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.刚刚经历了同样的问题。复制目标是连接到我的 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.
不用说该文件确实存在吗?无论如何,虽然您可能拥有权限,但实际运行 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?
你当然想过,但你尝试过吗?
即使在 Windows 上,我也总是使用
/
而不是\
,并且不记得复制目标有问题。you certainly thought about it, but have you tried
I always use the
/
instead of\
even on Windows and can't remember having a problem with the Copy target.这是 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.