users@glassfish.java.net

AccessControlException serving applet using GlassFish v2

From: <glassfish_at_javadesktop.org>
Date: Sat, 08 Dec 2007 06:21:39 PST

I have an applet which uses RMI to connect to a server and it runs fine when run through the NetBeans applet viewer. But when I run the HTML page that it is embedded in with GlassFish I get the following exception:

Exception in thread "Thread-7" java.security.AccessControlException: access denied (java.net.SocketPermission 10.1.1.3:61946 connect,resolve)
        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.checkConnect(Unknown Source)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory$AsyncConnector.<init>(Unknown Source)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
        at sun.rmi.server.UnicastRef.invoke(Unknown Source)
        at com.qu0ll.Test_Stub.register(Unknown Source)

when the applet first tries to access a server class method via RMI.

The only difference that I can see between the applet viewer environment and the GlassFish environment is that in NetBeans I can specify an applet.policy file to run with when using the applet viewer.

So how can I specify an applet.policy file for running an applet through GlassFish? Or is this problem not related to the applet.polic file at all?

-- 
And loving it,
-Q
_________________________________________________
Qu0llSixFour_at_gmail.com
(Replace the "SixFour" with numbers to email me)
[Message sent by forum member 'qu0ll' (qu0ll)]
http://forums.java.net/jive/thread.jspa?messageID=249182