11 messages in com.googlegroups.google-picasa-data-apiRe: Access Control Exception
FromSent OnAttachments
gwtpicasa15 Apr 2008 17:40 
Jeff Fisher (Google)16 Apr 2008 08:19 
gwtpicasa16 Apr 2008 19:16 
Jeff Fisher (Google)17 Apr 2008 09:47 
Jeff Fisher (Google)17 Apr 2008 09:55 
gwtpicasa17 Apr 2008 10:05 
gwtpicasa17 Apr 2008 15:11 
gwtpicasa17 Apr 2008 17:27 
Jeff Fisher (Google)17 Apr 2008 17:37 
Jeff Fisher (Google)17 Apr 2008 17:37 
Jeff Fisher (Google)17 Apr 2008 17:40 
Subject:Re: Access Control Exception
From:Jeff Fisher (Google) (api.@google.com)
Date:04/17/2008 05:40:08 PM
List:com.googlegroups.google-picasa-data-api

Wahoo! Glad you were able to get this to work in a locked down environment. :)

-Jeff

On Apr 17, 5:27 pm, gwtpicasa <pana@yahoo.com> wrote:

Never mind I made it to work using Custom jar: This what I did: In GoogleGDataRequest.constructor:Commented if loop In GoogleGDataRequest.execute : Commented everything else but super.execute(); In HttpGDataRequest.execute: Removed calls to System.getproperty and setproperties and removed finally block

Thanks for your help Jeff.

On Apr 17, 6:12 pm, gwtpicasa <pana@yahoo.com> wrote:

I am almost there with custom jar. But getting this error.. this time.. Any suggestion to come over this lat one...? Thanks java.security.AccessControlException: access denied (java.util.PropertyPermission http.strictPostRedirect read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java: 323) at java.security.AccessController.checkPermission(AccessController.java: 546) at java.lang.SecurityManager.checkPermission(SecurityManager.java: 532) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java: 1285) at java.lang.System.getProperty(System.java:652) at com.google.gdata.client.http.HttpGDataRequest.execute(Unknown Source) at com.google.gdata.client.http.GoogleGDataRequest.execute(Unknown Source) at com.google.gdata.client.Service.getFeed(Unknown Source) at com.google.gdata.client.Service.getFeed(Unknown Source) at com.google.gdata.client.GoogleService.getFeed(Unknown Source) at com.google.gdata.client.Service.getFeed(Unknown Source) at com.*.test.server.picasa.PicasawebClient.getFeed(PicasawebClient.java: 262) at com.*.test.server.picasa.PicasawebClient.getAlbums(PicasawebClient.java: 82) at com.*.test.server.picasa.PicasawebClient.getAlbums(PicasawebClient.java: 104)

Me too was missing to mention it. I tried this before : picasawebService.setHandlesCookies(false); But was not helping me either.(is this a bug?...) Let me go for custom jar and try... Thanks for your help.

On Apr 17, 12:55 pm, "Jeff Fisher (Google)" <api.@google.com> wrote:

Bah, shows I should read the javadoc before I try to go through the source looking for comments. There also is a property of the base service class called "setHandlesCookies" which might do what you want.

Try adding

picasawebService.setHandlesCookies(false);

to your code.

Cheers, -Jeff

Hi again,

Well... that's not fun if they don't even let you set runtime properties at all. I think the only solution as this stage would be to download the source package, manually edit src/com/google/gdata/client/ http/GoogleGDataRequest.java on line 327 and remove the entire if block and all the code it contains. Then recompile your own custom JAR files.

Cheers, -Jeff

On Apr 16, 7:17 pm, gwtpicasa <pana@yahoo.com> wrote:

Thanks Jeff! I am afraid it does not work. New Error: Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission com.google.gdata.DisableCookieHandler write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java: 323) at java.security.AccessController.checkPermission(AccessController.java: 546) at java.lang.SecurityManager.checkPermission(SecurityManager.java: 532) at java.lang.System.setProperty(System.java:727) at com.*.test.server.picasa.PicasawebClient.<init>(PicasawebClient.java: 45) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java: 27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java: 84)

I have jailed and shared jvm too! Appreciate your further suggestions...

On Apr 16, 11:19 am, "Jeff Fisher (Google)" <api.@google.com> wrote:

Hi,

This is a good question! I dug through the source to find this gem:

/** * If set, this System property will globally disable interception and * handling of cookies for all GData services. */ public static final String DISABLE_COOKIE_HANDLER_PROPERTY = "com.google.gdata.DisableCookieHandler";

So it looks like if you put something like

System.setProperty("com.google.gdata.DisableCookieHandler", "true");

at the top of your code, it should disable the cookie handling code (which you shouldn't really ever need, to the best of my knowledge. I believe this is a hack that's only useful for the Calendar API.)

Let me know if that works for you, since I don't have a jailed account to try it out in. :)

Cheers, -Jeff

On Apr 15, 5:40 pm, gwtpicasa <pana@yahoo.com> wrote:

I built widget that displays Image either from local drive or from Picasa Public albums without any authsub. Logic goes like this: For getting Albums the RPC Code: public AlbumDetails[] getPicasaAlbums(String username) throws IOException, SAXException, ServiceException { List<AlbumEntry> sets = picasawebClient.getAlbums(); ImageDetails[] albums = new ImageDetails[sets.size()]; Iterator iter = sets.iterator(); for (int i = 0; i < albums.length; i++) { AlbumEntry set = (AlbumEntry) iter.next(); List<MediaThumbnail> thumbnails = set.getMediaThumbnails(); MediaThumbnail thumbnail = thumbnails.get(0); String thumbnailUrl = thumbnail.getUrl(); set.getMediaThumbnails(); ----

---------------------- /// Album id is sent to client in return object so the urls of album cover...

}

return albums; }

For getting Images for given album public ImageDetails[] getImages( String username, String albumId, int perPage, int page) { PicasawebService picasawebService = new PicasawebService("abhignya"); URL albumUrl = new URL(albumId); AlbumEntry albumEntry = picasawebService.getEntry(albumUrl, AlbumEntry.class);

List<PhotoEntry> photos = this.picasawebClient.getPhotos(albumEntry); if (photos.size() == 0) { images = new ImageDetails[1]; } else { images = new ImageDetails[photos.size()]; for (int i=0; i<images.length; i++) {

PhotoEntry entry =(PhotoEntry) photos.get(i); images[i] = new ImageDetails();

images[i].setImageName(entry.getTitle().getPlainText());

images[i].setImageDescription(entry.getDescription().getPlainText()); MediaContent mediaContent = (MediaContent) entry.getContent(); URL imageURL = new URL(mediaContent.getUri());

images[i].setSourcePath(imageURL.toString());

return images; }

This works perfectly when it is hosted on tomcat localhost with full access. But fails in shared hosting environment where I have limited access(I can't get better access for the service I bought)

The error I get is here from tomact logs. Is there any way around for this?

Caused by: java.security.AccessControlException: access denied (java.net.NetPermission setCookieHandler) at java.security.AccessControlContext.checkPermission(AccessControlContext.java: 323) at java.security.AccessController.checkPermission(AccessController.java: 546) at

...

read more »