I'm having trouble using Java to access the Google Spreadsheet through
its GData API. While I was able to run my application successfully as
a client application running on AppletViewer, when I started to
develop a web-based version of the application, I ran into Java
security issues that I haven't been able to get around. Namely, I'm
getting the following Exception:
java.lang.RuntimeException: java.security.AccessControlException:
access denied (java.net.SocketPermission
www.google.com resolve)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
886)
at
sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:
1907)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:
376)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:
318)
at
com.google.gdata.client.http.AuthSubUtil.exchangeForSessionToken(Unknown
Source)
at
com.google.gdata.client.http.AuthSubUtil.exchangeForSessionToken(Unknown
Source)
at DBInterface.getService(DBInterface.java:132)
at DBInterface.init(DBInterface.java:49)
at GUI.init(GUI.java:99)
at sun.applet.AppletPanel.run(AppletPanel.java:378)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.security.AccessControlException: access denied
(java.net.SocketPermission
www.google.com resolve)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:
264)
at
java.security.AccessController.checkPermission(AccessController.java:
427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
at java.net.InetAddress.getAllByName(InetAddress.java:1061)
at java.net.InetAddress.getByName(InetAddress.java:958)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:
260)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:335)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:
176)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:
747)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:
162)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
916)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:
367)
... 8 more
Clearly, I'm not properly setting up my applet. I've tried self-
signing the jar I'm using, but that doesn't seem to work and I haven't
found a good resource on how to do this properly. Does anybody have
experience or recommendations on how I can properly give the correct
permissions to my applet?
Thank you,
Blaine