Skip to main content


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 09:32
Balint Pamer is currently offline Balint PamerFriend
Messages: 3
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 119 times)
  • Attachment: difference.png
    (Size: 19.16KB, Downloaded 469 times)

[Updated on: Wed, 24 July 2013 09: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: Fri Apr 26 04:02:47 GMT 2024

Powered by FUDForum. Page generated in 0.02460 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top