I have an access deniec security issue on my java applet. I have read many threads about this issue but any solution works ;/

I have tried:
1. change paths to user home directory, etc
2. to pass dialogs container instead of null
3. run browser "as admin"
4. change policy.java to access all (even viruses are permitted :))
5. run code as privileged code
6. the applet is signed
7. search for all similar problem through the internet

When I run this code in debugger (appletviewer) all works fine. But when I send the jar to production server, the JFileChooser.showDialog() function fails with an exception: access denied (java.util.PropertyPermission user.dir read).

Applet is signed. On start it ask for "Run" and displays information that the applet will have all permission (on read more...).

It may be a system issue, because I have a signal that the same applet works on WindowsXP, but surely not in Windows Vista and Windows 7 x64.


Here is the function that is throwing an exception:

Java Code:
public static String getUserPath(final String exampleFile)
	{
		try {
			final String dir=System.getProperty("user.home")+System.getProperty("file.separator"); 
			
			AccessController.doPrivileged(new PrivilegedAction() {
		        public Object run() {
		            // perform the security-sensitive operation here
		        	JFileChooser chooser = new JFileChooser(dir);
				chooser.setFileFilter(new PdfFileFilter(exampleFile));
					
				[B]if(chooser.showDialog(null, LanguageConst.getTxt(LanguageConst.txtZapisz)) == JFileChooser.APPROVE_OPTION) { // <--- HERE IS THE PROBLEM[/B]
				    	if (chooser.getSelectedFile().getAbsolutePath().toLowerCase().endsWith(".pdf")) {
				    		return chooser.getSelectedFile().getAbsolutePath();
				    	}
				    	else {
				    		return chooser.getSelectedFile().getAbsolutePath()+".pdf";
				    	}
				    } else {
				    	return "";
				    }
		        }
		    });
		} catch (Exception ex) {
			MSG.Error(ex.getMessage());
		}

		return "";
	}

How to fix this issue? Maybe something is wrong with the certificate? ;/ I have no idea, I tried all but nothing works. Please help.



-------------------------------------------

kaijudo
Automation Building