Hi All,

I am trying to use Google Data API library on App cloud. When trying
to invoke the API, I am getting the following runtime permission
error.

java.security.AccessControlException: access denied
("java.net.NetPermission" "getCookieHandler")
        
java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
        
java.security.AccessController.checkPermission(AccessController.java:559)
        java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        java.net.CookieHandler.getDefault(CookieHandler.java:75)
        
com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.<init>(GoogleGDataRequest.java:337)
        
com.google.gdata.client.http.GoogleGDataRequest$GoogleCookieHandler.<init>(GoogleGDataRequest.java:326)
        
com.google.gdata.client.http.GoogleGDataRequest.<clinit>(GoogleGDataRequest.java:429)
        
com.google.gdata.client.http.GoogleGDataRequest$Factory.createRequest(GoogleGDataRequest.java:94)
        
com.google.gdata.client.http.HttpGDataRequest$Factory.getRequest(HttpGDataRequest.java:165)
        com.google.gdata.client.Service.createRequest(Service.java:760)
        
com.google.gdata.client.GoogleService.createRequest(GoogleService.java:539)
        com.google.gdata.client.Service.createFeedRequest(Service.java:1156)
        com.google.gdata.client.Service.getFeed(Service.java:997)
        com.google.gdata.client.GoogleService.getFeed(GoogleService.java:645)
        com.google.gdata.client.Service.getFeed(Service.java:1017)
        
org.wso2.eventsmng.handler.OAuthHandler.loginOAuth2(OAuthHandler.java:168)
        
org.wso2.eventsmng.servlets.EventsController.processRequest(EventsController.java:60)
        
org.wso2.eventsmng.servlets.EventsController.doGet(EventsController.java:53)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        java.lang.reflect.Method.invoke(Method.java:606)
        org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
        org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:271)
        java.security.AccessController.doPrivileged(Native Method)
        javax.security.auth.Subject.doAsPrivileged(Subject.java:536)
        org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
        
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:166)

​As mentioned in Google App Engine Q&A [1] the work around is to add the
following to the appengine-web.xml.

<system-properties>
  <property name="com.google.gdata.DisableCookieHandler" value="true"/>
</system-properties>

Therefore, I tried to add followings into my web.xml.

 <env-entry>

<env-entry-name>com.google.gdata.DisableCookieHandler</env-entry-name>
        <env-entry-type>java.lang.Boolean</env-entry-type>
        <env-entry-value>true</env-entry-value>
 </env-entry>

I also tried `env-entry-type` as `java.lang.String` and all workarounds in
[2],  still getting the same error.

1. Any solution to get rid of this error?
2. How can I change these security policy configurations on the App Cloud?​

[1]
http://www.lhelper.org/dev/google-appengine-docs-20090422/appengine/kb/java.html#googledata
[2] https://code.google.com/p/gdata-java-client/issues/detail?id=122

-- 
With Regards,

*Rasika Perera*
Software Engineer
M: +94 71 680 9060 E: [email protected]
LinkedIn: http://lk.linkedin.com/in/rasika90

WSO2 Inc. www.wso2.com
lean.enterprise.middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to