Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Strange behaviour for 32 bit exported application(No exception thrown by FileOutputStream)
Strange behaviour for 32 bit exported application [message #1073187] Wed, 24 July 2013 05:32
Balint Pamer is currently offline Balint Pamer
Messages: 2
Registered: June 2013
Junior Member
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:
index.php/fa/15687/0/
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 18 times)
  • Attachment: difference.png
    (Size: 19.16KB, Downloaded 187 times)

[Updated on: Wed, 24 July 2013 05:49]

Report message to a moderator

Previous Topic:Source bundle generation for bundle only
Next Topic:how to add "move project action" to custom cnf
Goto Forum:
  


Current Time: Thu Aug 28 01:34:12 EDT 2014

Powered by FUDForum. Page generated in 0.04893 seconds