Strange behaviour for 32 bit exported application [message #1073187] |
Wed, 24 July 2013 05:32 |
Eclipse User |
|
|
|
Hello!
On our project, we have stumbled on a very strange (windows specific) behaviour:
When attempting to save a file as a regular user to the drive C root (e.g.: C:\file.txt), we get the expected access denied exception (as admin rights are needed), when run from eclipse.
But after exporting the application as a 32 bit executable and running it, no exception is thrown!
Attached is a small demo application, exhibiting the problem:
On the program start, it calls the following code (samplepart.java):
FileOutputStream out = new FileOutputStream("C:\\asd.txt");
out.close();
When run from eclipse, the new FileOutputStream-line will throw the expected exception.
When exported as a 32 bit .exe, no exception is thrown!
Tracing the code of the FileOutputStream constructor, I ended up seeing the exception coming from a native open()-call, so am pretty much stuck.
I could not reproduce this issue with a regular java application, exported as a .jar.
Can anyone help me further?
Thanks:
Balint Pamer
Edit:
Looking around with process monitor, I'm seeing actual differences between running from eclipse and from an exported application:

The standalone application (eclipse.exe) returns with REPARSE, while running from eclipse (javaw.exe) returns with ACCESS DENIED.
Attachment: test.zip
(Size: 17.51KB, Downloaded 134 times)
Attachment: difference.png
(Size: 19.16KB, Downloaded 505 times)
[Updated on: Wed, 24 July 2013 05:49] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02733 seconds