ektfetna1 / gdata-java-client

Automatically exported from code.google.com/p/gdata-java-client
1 stars 0 forks source link

[AccessControlException] Applet works on local, not on server #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use Spreadsheets API in an applet, on a server.
2. Attempt to authenticate using 
myService = new SpreadsheetService("My Application");       
myService.setUserCredentials(user,pass);
3.

What is the expected output? What do you see instead?
Expected output is the synchronization of spreadsheets, with debug output
to the page. Instead, runtime error and:
java.security.AccessControlException: access denied
(java.net.SocketPermission www.google.com:443 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.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
    at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(U
nknown
Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown
Source)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
    at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown
Source)
    at
com.google.gdata.client.GoogleAuthTokenFactory.makePostRequest(GoogleAuthTokenFa
ctory.java:537)
    at
com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFacto
ry.java:477)
    at
com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthToke
nFactory.java:336)
    at
com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:362)
    at
com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:317)
    at
com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:301)
    at SpreadsheetSynchronizer.<init>(SpreadsheetSynchronizer.java:108)
    at SpreadsheetSynchronizer.<init>(SpreadsheetSynchronizer.java:95)
    at SyncApplet.init(SyncApplet.java:36)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown
Source)
    at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied
(java.net.SocketPermission www.google.com:443 connect,resolve)

What version of the product are you using? On what operating system?
gdata-samples.java-1.32.0.zip; Windows XP, GoDaddy Hosting (Linux)

Please provide any additional information below.
Applet works fine when running from my local machine. As soon as I deploy
it, I get an error on authentication. I also tried deploying it on Ga Tech
servers in case it was a GoDaddy problem. Same result. 

Saw other thread on AccessControlException, but it seemed to be in relation
to the App Engine, which I am not using (though it looks pretty awesome!). 

Any ideas?

Original issue reported on code.google.com by kenstcl...@gmail.com on 4 Jun 2009 at 9:02

GoogleCodeExporter commented 9 years ago
Got a response from GoDaddy. They claim that port 443 is only open for hosting
accounts with SSL certs. Read another post that they block all ports but 80 and 
443.
Am currently looking into hosting it on the App Engine. Thanks.

Original comment by kenstcl...@gmail.com on 5 Jun 2009 at 3:47

GoogleCodeExporter commented 9 years ago
Its a generic error, it can be either because of a proxy or a local java 
security
policy settings.  I dont know whats causing the issue in your case.  Best would 
be to
consult the sun java forums to resolve the issue.  As far as this library is
concerned it uses standard http/https stack.   If you have already resolved the
issue, please share your experience so that will be useful for others.

Original comment by vbarat...@gmail.com on 24 Jul 2009 at 3:30

GoogleCodeExporter commented 9 years ago
my solution was simply to switch over to the appEngine in java. i never did get 
the
applet working. appEngine is more fun anyways!

Original comment by kenstcl...@gmail.com on 24 Jul 2009 at 7:26

GoogleCodeExporter commented 9 years ago
I am having this problem and try to find a solution.  Please does anybody has a
solution ?

Original comment by Alain.La...@gmail.com on 12 Jan 2010 at 10:02

GoogleCodeExporter commented 9 years ago
I had this exception, my solution was to sign all the jar of third party with 
Keytool.exe and jarsigner.exe at windows XP.

greetings

Original comment by gmartinez.code on 23 Feb 2010 at 7:07

Attachments: