Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to go out of the sandbox from a dynamically loaded class ?

0 views
Skip to first unread message

Arnaud

unread,
Nov 26, 2002, 5:42:12 PM11/26/02
to
Hi everybody.

I need to write a Java 1.3 signed applet that can dynamically load
additionnal signed JAR modules.

In order to load the additionnal signed JAR files, I use the URLClassLoader.
Additionnal classes are successully loaded but if I invoke a method that,
for example, writes a file, I get this :
java.security.AccessControlException: access denied (java.io.FilePermission
c:\loaded.txt write)

at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkWrite(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at Applet1.logWrite(Applet1.java:63)
at ExternalClass.add(ExternalClass.java:12)
at java.lang.reflect.Method.invoke(Native Method)
at Applet1.baseURL_EnterHit(Applet1.java:123)
at Applet1$SymAction.actionPerformed(Applet1.java:80)
at java.awt.TextField.processActionEvent(Unknown Source)
at java.awt.TextField.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I don't understand why it happens because the main applet JAR and the
additionnal JAR are signed by the same way, with the same certificate.

Can someone help me ???

PS : modifying the "java.policy" file is not an acceptable solution in my
context

0 new messages