java.security.AccessControlException: access denied (java.io.FilePermission

I have a signed applet. Its invoking a webservice using apache axis. I cannot do anything to the client's policy files. I am getting the following exception (I have the console turned on, so there are some extra messages):

Registered modality listener

Invoking JS method: document

Invoking JS method: URL

Referencing classloader: sun.plugin.ClassLoaderInfo@14e8cee, refcount=2

Loading applet ...

Initializing applet ...

Starting applet ...

Finding information ...

Releasing classloader: sun.plugin.ClassLoaderInfo@14e8cee, refcount=1

Done ...

java.security.AccessControlException: access denied (java.io.FilePermission client-config.wsdd read)

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)

at java.security.AccessController.checkPermission(AccessController.java:401)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)

at java.lang.SecurityManager.checkRead(SecurityManager.java:863)

at java.io.File.canRead(File.java:636)

at org.apache.axis.configuration.FileProvider.check(FileProvider.java:147)

at org.apache.axis.configuration.FileProvider.<init>(FileProvider.java:115)

at org.apache.axis.configuration.EngineConfigurationFactoryDefault.getClientEngineConfig(EngineConfigurationFactoryDefault.java:144)

at org.apache.axis.client.Service.getEngineConfiguration(Service.java:801)

at org.apache.axis.client.Service.getAxisClient(Service.java:143)

at org.apache.axis.client.Service.<init>(Service.java:152)

at com.kalimbacorp.www.KeyGenServer.KeyManagerLocator.<init>(KeyManagerLocator.java:10)

at src.CryptoApplet.btnGenerateKeyActionPerformed(CryptoApplet.java:309)

at src.CryptoApplet.access$100(CryptoApplet.java:40)

at src.CryptoApplet$2.actionPerformed(CryptoApplet.java:154)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)

at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)

at java.awt.Component.processMouseEvent(Component.java:5100)

at java.awt.Component.processEvent(Component.java:4897)

at java.awt.Container.processEvent(Container.java:1569)

at java.awt.Component.dispatchEventImpl(Component.java:3615)

at java.awt.Container.dispatchEventImpl(Container.java:1627)

at java.awt.Component.dispatchEvent(Component.java:3477)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)

at java.awt.Container.dispatchEventImpl(Container.java:1613)

at java.awt.Component.dispatchEvent(Component.java:3477)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

I have this in my init method:

Policy.setPolicy(new Policy()

{

public PermissionCollection getPermissions(CodeSource codesource)

{

Permissions perms = new Permissions();

perms.add(new AllPermission());

return (perms);

}

public void refresh()

{

}

}

);

Thanks for any help

Ali

[3992 byte] By [akhawaja] at [2007-9-30 12:49:07]
# 1

This doesn't seem to be a problem with javascript calling a method of the applet

http://forum.java.sun.com/thread.jsp?forum=63&thread=524815

second post

I never used the org.apache package but how does the applet find these packages (classpath/manifest)

Does it help when you set a policy for the org.apache packages?

Does it help when you set allpermission to all code (in the "grant {" section)?

I know that eventually you cannot do this but just for debugging perposes.

harmmeijer at 2007-7-4 17:03:34 > top of Java-index,Security,Signed Applets...
# 2

I have exactly the same problem.

If I run my Signed Applet from the IDE then it works fine and I can Access the Web Service and get back some data.

However if I run the applet from within the browser then I get EXACTLY the same Exception as described in the previous article.

I have moved the apache axis jar's to the JRE's "ext\lib" directory just as you would do with an installed extension.

I have considered signing the Apache AXIS Jar's using our own valid signature. (Yet to try out ) but I wanted to find a more code based solution to this problem.

Currently using the j2sdk1.4.2_04 and jre 1.4.2_04. On Windows 2000 Server

Poor_Sitar_player at 2007-7-4 17:03:34 > top of Java-index,Security,Signed Applets...
# 3
I have the same problem and i am excute the appended solutionbut still the the problem exitcan somebody help me
Amrhussein at 2007-7-4 17:03:34 > top of Java-index,Security,Signed Applets...