Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not move to final path in Windows #16

Open
jry opened this issue Sep 20, 2011 · 6 comments
Open

Could not move to final path in Windows #16

jry opened this issue Sep 20, 2011 · 6 comments

Comments

@jry
Copy link

jry commented Sep 20, 2011

There seems to be a problem with finalizing the file on Windows (Windows 7 Professional 64-bit). The move command fails. On Mac OSX the same code works fine.

Stack trace:

Internal Server Error (500) for request GET /press/js/ZsmbmSbZpEbptzVZoAAqYQJJ.js

Execution exception (In {module:press-1.0.23}/app/press/io/OnDiskCompressedFile.java around line 102)
PressException occured : Successfully wrote compressed file to temporary path C:\Projects\Sourcecode\WebApp\medi
th C:\Projects\Sourcecode\WebApp\media\press-cache\bVyCcFVMmZbLVrEEVkWXaQJJ.js

play.exceptions.JavaExecutionException: Successfully wrote compressed file to temporary path
C:\Projects\Sourcecode\WebApp\media\press-cache\bVyCcFVMmZbLVrEEVkWXaQJJ.js.tmp
But could not move it to final path
C:\Projects\Sourcecode\WebApp\media\press-cache\bVyCcFVMmZbLVrEEVkWXaQJJ.js
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:229)
at Invocation.HTTP Request(Play!)
Caused by: press.PressException: Successfully wrote compressed file to temporary path
C:\Projects\Sourcecode\WebApp\media\press-cache\bVyCcFVMmZbLVrEEVkWXaQJJ.js.tmp
But could not move it to final path
C:\Projects\Sourcecode\WebApp\media\press-cache\bVyCcFVMmZbLVrEEVkWXaQJJ.js
at press.io.OnDiskCompressedFile.close(OnDiskCompressedFile.java:102)
at press.Compressor.writeCompressedFile(Compressor.java:354)
at press.Compressor.getCompressedFile(Compressor.java:323)
at press.Compressor.getCompressedFile(Compressor.java:291)
at press.JSCompressor.getCompressedFile(JSCompressor.java:32)
at controllers.press.Press.getCompressedJS(Press.java:25)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:546)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:500)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:476)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:471)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:159)
...

@dirkmc
Copy link
Owner

dirkmc commented Sep 20, 2011

Thanks for the bug report.
People have mentioned this in the past on different versions of Windows, however unfortunately I have no way to test as I don't own a Windows machine. It seems the JVM implementation on Windows is quite buggy. If you have the time and inclination I'd really appreciate someone making a patch to fix the issue.

@jry
Copy link
Author

jry commented Sep 20, 2011

Thanks for the quick reply. Seems like File.renameTo() is quite unreliable in Windows as you say. FileUtils.moveFile() in the apache.commons.io library might be an alternative. Unfortunately, I don't have the time to look into a patch right now. Since we run a mixed OS project I just have to accept it won't work on my machine for now. I'll see if I can find the time for a patch later.

@dirkmc
Copy link
Owner

dirkmc commented Sep 20, 2011

Thanks, I appreciate the help.

@mebibou
Copy link

mebibou commented Mar 29, 2013

So has anyone done a patch for this after all? we have the same issue, and if no-one has started working on it maybe we could create a patch for it

@dirkmc
Copy link
Owner

dirkmc commented Mar 29, 2013

Hi, thanks for your interest in the plugin.
I guess if you're using the latest version of press then no one has fixed it yet. Sure, if you can create a patch that would be great.
Thanks,
Dirk

@mebibou
Copy link

mebibou commented Apr 3, 2013

Someone on my team made a patch for this: #40

It has been tested on Windows 7 and on MacOs X latest versions and it works. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants