|Strange behaviour for 32 bit exported application [message #1073187]
||Wed, 24 July 2013 09:32
| Balint Pamer
Registered: June 2013
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");
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?
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.
(Size: 17.51KB, Downloaded 57 times)
(Size: 19.16KB, Downloaded 336 times)
[Updated on: Wed, 24 July 2013 09:49]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02341 seconds