Weird Gson ConcurrentModificationException

1,005 views
Skip to first unread message

sheldon

unread,
Feb 8, 2013, 5:38:44 PM2/8/13
to googl...@googlegroups.com
Hi,

I'm getting a ConcurrentModificationException when attempting to parse a JSON string on a high-volume server hosted on AppEngine. 

Here is the calling source code, run in a single thread: 

Gson gson = new Gson(); 
Type mapType = new TypeToken<Map<String, MyValueObject>>(){}.getType();
Map<String, MyValueObject> stringToMyValueObject = gson.fromJson(stringToMyValueObjectJSON, mapType);

And here is the error I'm getting:

java.util.ConcurrentModificationException
	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:782)
	at java.util.ArrayList$Itr.next(ArrayList.java:754)
	at com.google.apphosting.runtime.security.preverifier.intercept.NameTranslator.hasMirrorMethod(NameTranslator.java:233)
	at com.google.apphosting.runtime.security.preverifier.PreVerifier.testNamespace(PreVerifier.java:387)
	at com.google.apphosting.runtime.security.preverifier.PreVerifier.getUnmirroredClass(PreVerifier.java:349)
	at com.google.apphosting.runtime.security.ExceptionScrubber$PreVerifierMirrorLookup.getUnmirroredClass(ExceptionScrubber.java:439)
	at com.google.apphosting.runtime.security.ExceptionScrubber.getUnmirroredFrame(ExceptionScrubber.java:387)
	at com.google.apphosting.runtime.security.ExceptionScrubber.scrubFrames(ExceptionScrubber.java:338)
	at com.google.apphosting.runtime.security.ExceptionScrubber.scrubException_(ExceptionScrubber.java:143)
	at com.google.apphosting.runtime.security.ExceptionScrubber.scrubException(ExceptionScrubber.java:115)
	at com.google.apphosting.runtime.security.ExceptionScrubber.logScrubAndThrow(ExceptionScrubber.java:275)
	at com.google.apphosting.runtime.security.shared.RuntimeVerifier.logScrubAndThrowException(RuntimeVerifier.java:440)
	at com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.getConstructor(Class_.java:605)
	at com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.getDeclaredConstructor(Class_.java:279)
	at com.google.gson.internal.ConstructorConstructor.newDefaultConstructor(ConstructorConstructor.java:82)
	at com.google.gson.internal.ConstructorConstructor.get(ConstructorConstructor.java:66)
	at com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:128)
	at com.google.gson.Gson.getAdapter(Gson.java:353)
	at com.google.gson.Gson.fromJson(Gson.java:794)
	at com.google.gson.Gson.fromJson(Gson.java:761)
	at com.google.gson.Gson.fromJson(Gson.java:710)

Am I doing something wrong, or is this a Gson bug?

Thanks!

sheldon

keryor

unread,
Feb 27, 2013, 7:31:08 PM2/27/13
to googl...@googlegroups.com
bump

Jesse Wilson

unread,
Feb 28, 2013, 12:22:51 AM2/28/13
to googl...@googlegroups.com
This looks like a bug in Google App Engine. You'll need to report it there.

Lisandro Pavetti

unread,
Mar 11, 2015, 3:15:50 PM3/11/15
to googl...@googlegroups.com
Hi, did you ever find a solution for this issue?
Reply all
Reply to author
Forward
0 new messages