• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • hsingh
  • Reporter: hhuynh
  • February 01, 2010
  • 0
  • Watchers: 2
  • January 17, 2013
  • June 18, 2010

Description

A newly added field in Element.java class upsets GAE:

private static final AtomicLongFieldUpdater HIT\_COUNT\_UPDATER = AtomicLongFieldUpdater.newUpdater(Element.class, "hitCount");

Here’s the stacktrace:

Caused by: java.lang.RuntimeException: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers) at java.util.concurrent.atomic.AtomicLongFieldUpdater$CASUpdater.(Unknown Source) at java.util.concurrent.atomic.AtomicLongFieldUpdater.newUpdater(Unknown Source) at net.sf.ehcache.Element.(Element.java:56) ... 54 more Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:355) at java.security.AccessController.checkPermission(AccessController.java:567) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkMemberAccess(Unknown Source) at java.lang.Class.checkMemberAccess(Unknown Source) at java.lang.Class.getDeclaredField(Unknown Source)

Comments

Tim Eck 2010-02-01

Obviously we have no automated (or regularly run manual) testing of ehcache in GAE :-(

Fiona OShea 2010-02-03

Jason is resetting up the test. See DEV-3748

http://rh5fm0.terracotta.lan:9000/view/Ehcache/job/ehcache- googleappengine_trunk/

Fiona OShea 2010-02-03

Nitin can you verify that when DEV-3748 is resolved (setup the google app test) that it will catch this issue?

Nitin Rana 2010-02-11

this project is executing “Executing Maven: -B -f /export1/cruise/hudson/workspace/ehcache-googleappengine_trunk/googleappengine/pom.xml clean install”

IT is not not executing the test.

Fiona OShea 2010-02-11

Greg, can you take a quick look at this issue? I think some test should be running, do we have the correct information? thanks Fiona

gluck 2010-02-11

Steve

The GoogleAppEngine module which I was working on in October doesn’t do anything useful yet.

Ehcache-core can be tested in the meantime manually by our testers by creating a simple web app in GAE and adding CacheManager.getInstance() to a JSP then hitting it and making sure it does not explode.

The local test harness should give the same results but I have not gotten back to this.

This issue should be fixed for 2.0.

Greg

Chris Dennis 2010-02-12

The java.util.concurrent.atomic.AtomicLongFieldUpdater class that trips up GAE is on the class white list (http://code.google.com/appengine/docs/java/jrewhitelist.html). So this seems to be a GAE bug to me. Looking through the GAE issue tracker I found a couple of bugs that look similar:

http://code.google.com/p/googleappengine/issues/detail?id=2042 http://code.google.com/p/googleappengine/issues/detail?id=2658

I’ve also found references to the sandbox in the production servers not being the same as the sandbox in the local dev environment. In particular quite a few people have talked about code that is loaded with a custom classloader not being granted the same permissions as code loaded with the system classloader.

Chris Dennis 2010-02-12

I created a simple test in GAE that attempted to instantiate an AtomicLongFieldUpdater - this works perfectly in the development sandbox that Google provide. However when uploaded to the Google servers it triggered the same exception seen above. Since AtomicLongFieldUpdater is supposed to be supported I have filed an issue with Google about this problem:

http://code.google.com/p/googleappengine/issues/detail?id=2769

Chris Dennis 2010-02-12

Pushing this out to Esperance while we wait for a response from Google. I see two possible eventualities here:

  1. Google fix the AtomicLongFieldUpdater and everything then works fine.
  2. Google remove the AtomicLongFieldUpdater form the JDK white-list and we have to rework this code (probably with an associated rise in heap usage)

Let wait and see what Google have to say on the matter first…

gluck 2010-04-12

Toby Reyelts has implemented a fix for GAE which will be out in late May/early June.

Chris Dennis 2010-04-13

Cool, thanks for expediting this Greg. When Toby closes the GAE issue, I’ll close this.

Chris Dennis 2010-06-17

I’m punting this to pending until the underlying Google issue is closed. When that happens I will resolve and assign this to the then current dev target.

Chris Dennis 2010-06-18

Underlying Google App Engine issue has been closed.

Tim Eck 2010-06-18

but have we verified anything on GAE?

Chris Dennis 2010-06-18

I’m was assuming (hoping) that some lovely person in QA would verify this in the GAE production setup before closing this. I have a zipped GAE project attached to my Google issue that should work correctly if they have fixed this in production.

Fiona OShea 2010-06-18

It will be tested by QA. thanks

Himadri Singh 2010-07-05

Cannot verify this bcoz of dependency JIRA.

Ludovic Orban 2010-09-16

I’ve implemented a workaround for the GAE bug as it apparently isn’t yet fixed. It’s in r2789.