Issue 440 in google-gson: Infinity loop at recursive calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)

1,291 views
Skip to first unread message

googl...@googlecode.com

unread,
Apr 29, 2012, 1:31:40 PM4/29/12
to google-gson...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 440 by metricst...@gmail.com: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

What steps will reproduce the problem?
I do not have access to source code, but the project worked fine with GSON
1.71 but this regression is observed in GSON 2.1.

What is the expected output? What do you see instead?
Normally generated JSON structure.

What version of the product are you using? On what operating system?
GSON 2.1 on Windows 7, replacing with older GSON 1.71 eliminate the problem.


Please provide any additional information below.
Unfortunatelly full stack trace impossible to get, due stack overflow, here
is snippet:

at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:355)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:117)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)


googl...@googlecode.com

unread,
May 4, 2012, 5:54:58 AM5/4/12
to google-gson...@googlegroups.com

Comment #1 on issue 440 by enrique....@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I got this issue too, but it worked fine until I upgraded to the latest JDK
1.7u4, so I guess it will soon be a problem for many developers.

googl...@googlecode.com

unread,
May 4, 2012, 4:05:00 PM5/4/12
to google-gson...@googlegroups.com

Comment #2 on issue 440 by metricst...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I got it with u3. Interesting if the problem is really GSON or JDK.

googl...@googlecode.com

unread,
Jun 29, 2012, 11:21:59 PM6/29/12
to google-gson...@googlegroups.com
Updates:
Status: Accepted
Labels: -Priority-Medium Priority-High

Comment #3 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

Very interesting. Could you share what type you were serializing? I'd love
to get to the bottom of this.

googl...@googlecode.com

unread,
Jul 23, 2012, 9:08:43 AM7/23/12
to google-gson...@googlegroups.com

Comment #4 on issue 440 by vijay.ra...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I too got the same exception when loading the java objects from json file.
I have registered JsonDeserializer adapter for polymorphic classes.
I could not start the application as the startup servlet need to parse and
load the configured objects in the json file.
error stack attached

Attachments:
err.txt 186 KB

googl...@googlecode.com

unread,
Sep 2, 2012, 5:42:58 PM9/2/12
to google-gson...@googlegroups.com

Comment #5 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

There isn't much I can do about this until we know which type was being
serialized.

googl...@googlecode.com

unread,
Sep 10, 2012, 9:18:01 AM9/10/12
to google-gson...@googlegroups.com

Comment #6 on issue 440 by m...@knowit.no: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

This could produced by any number of weird/invalid classes, such as:

class TestClass {
Thread tx;
}

googl...@googlecode.com

unread,
Sep 10, 2012, 10:09:16 AM9/10/12
to google-gson...@googlegroups.com

Comment #7 on issue 440 by myem...@email123.com: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

class TestClass { Thread t; }

Although no json interpretation could be expected, a more graceful error
would be nice.

googl...@googlecode.com

unread,
Sep 24, 2012, 11:06:55 PM9/24/12
to google-gson...@googlegroups.com

Comment #8 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

This bug reproduces with this test:

static class ToResolve<T> {
List<T> list;

public void testResolve() throws Exception {
System.out.println($Gson$Types.resolve(new TypeToken<ToResolve<?
extends T>>() {}.getType(), ToResolve.class,
ToResolve.class.getDeclaredField("list").getGenericType()));
}
}

public void testResolve() throws Exception {
new ToResolve<Void>().testResolve();
}


It will also reproduce with Guice by using a TypeLiteral instead of a
TypeToken.
System.out.println(new TypeLiteral<ToResolve<? extends T>>() {}
.resolve(ToResolve.class.getDeclaredField("list").getGenericType()));

googl...@googlecode.com

unread,
Sep 24, 2012, 11:23:52 PM9/24/12
to google-gson...@googlegroups.com
Updates:
Status: WontFix

Comment #9 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I've been staring at this for a while and I'm starting to think it's a
programming error. When this situation comes up, the runtime types are a
hall of mirrors!

Outermost we have our declaring class: ToResolve<T>.
It creates a ToResolve<? extends T>, so its T is defined as ? extends T.
That wildcard is resolved to <? extends ? extends ? extends ? extends ...
T>, never reaching a definite type.

We could try to naively defend against this, but we'd still be broken for
many cases. There's an arbitrary number of ways to make a type recurse onto
itself.
ToResolve<? super List<T>>

We could keep an explicit stack, and if we ever attempt to resolve a type
that's already on the stack, we've entered an illegal recursion and could
terminate immediately without resolution. This is unsatisfying but it would
work.

I think the right solution is for impacted apps to rethink their models.
Why are they serializing types that are not well-defined? Why are they
serializing 'Thread' objects without a type adapter? Is this just capturing
a lot of information for debugging? That's a bad idea, particularly since
circular references are also possible.

I'm willing to hear genuine use cases here, but I think the solution is
going to be to forbid this case and leave the stack overflow as-is.

googl...@googlecode.com

unread,
Dec 12, 2012, 11:58:08 AM12/12/12
to google-gson...@googlegroups.com

Comment #10 on issue 440 by glouglou...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

The problem I encountered was :
* same stack trace
* able to reproduce, again and again.
* able to debug,
* origin of troubles : the serializer wasn't registered for the real type
of the object (using registerTypeAdapter) but for a mother class of it
(found it through debug).
* explaination of what happened in my case : the Gson object found by
itself acceptable adapter for the real object, but stumbled upon deep
hidden object java.lang.ref.ReferenceQueue which had a member pointing to
the object itself, hence the stackoverflow, as the serializer looped over
it.

* correction : added a-bit-crappy command :
gsonBuilder.registerTypeAdapter(objectToSerialize.getClass(), // to get
its real type
objectToSerializeSerializer);
(as the real type class of the object to serialize is private).

googl...@googlecode.com

unread,
Jan 18, 2013, 3:29:23 AM1/18/13
to google-gson...@googlegroups.com

Comment #11 on issue 440 by nelepo...@gmail.com: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I have same problem when using API 17.
On smaller API versions it's all OK.
Why on API 17 - i got StackOverflow error?

googl...@googlecode.com

unread,
Jan 18, 2013, 9:54:57 AM1/18/13
to google-gson...@googlegroups.com

Comment #12 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I believe it was in API 17 that the internals of WeakReference and
SoftReference changed to be self-referent, which would trigger this. Are
you using Gson to serialize a WeakReference or SoftReference? If you are,
you should write your own TypeAdapter for those types.

googl...@googlecode.com

unread,
Jan 18, 2013, 1:41:52 PM1/18/13
to google-gson...@googlegroups.com

Comment #13 on issue 440 by Android...@HorizonSoftware.com: Infinity loop
at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I am seeing this issue as well, and only on API 17. API 16 and lower work
fine.

01-18 13:32:10.146: E/AndroidRuntime(831): FATAL EXCEPTION: main
01-18 13:32:10.146: E/AndroidRuntime(831): java.lang.StackOverflowError
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:355)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:117)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.Gson.getAdapter(Gson.java:353)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.java:82)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.Gson.getAdapter(Gson.java:353)
01-18 13:32:10.146: E/AndroidRuntime(831): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.<init>(ReflectiveTypeAdapterFactory.jav


googl...@googlecode.com

unread,
Feb 4, 2013, 11:05:21 AM2/4/13
to google-gson...@googlegroups.com

Comment #14 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

Issue 496 has been merged into this issue.

googl...@googlecode.com

unread,
Feb 5, 2013, 5:57:34 PM2/5/13
to google-gson...@googlegroups.com

Comment #15 on issue 440 by rkat...@gmail.com: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

Here is my case, I have this JSON response that I want to convert to a java
object, with GSON v1.7.1 it works just fine, while with 2.2.2 it fails with
the StackOverflow error on Android API 17, what am I doing wrong?

Attachments:
ret_json.txt 293 bytes
java_code.java 560 bytes

googl...@googlecode.com

unread,
Feb 5, 2013, 6:04:15 PM2/5/13
to google-gson...@googlegroups.com

Comment #16 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

The problem is classes like SoftReference and WeakReference. Are you
serializing either of those? (Because those classes have self-referential
generics.)

googl...@googlecode.com

unread,
Feb 6, 2013, 2:07:31 AM2/6/13
to google-gson...@googlegroups.com

Comment #17 on issue 440 by rkat...@gmail.com: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

No, I don't have the classes serialized, and there are no self referential,
the main class has 2 sub types, which are just simple pojo 1 level String
or int types..

googl...@googlecode.com

unread,
Feb 6, 2013, 2:43:38 AM2/6/13
to google-gson...@googlegroups.com

Comment #18 on issue 440 by d...@aylanetworks.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

No SoftReference or WeakReferences in our code either. Very basic classes
that work on Android 4.1.2 and don't on 4.2.x. Not a Java expert and am
unclear on how, if this is an internals issue, gson v1.71 resolves the
issue? Thanks.

googl...@googlecode.com

unread,
Feb 6, 2013, 9:31:53 AM2/6/13
to google-gson...@googlegroups.com
Updates:
Status: New
Labels: -Priority-High Priority-Critical

Comment #19 on issue 440 by limpbizkit: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

Dan: it's a problem with types that circularly reference themselves. It's
most notable in WeakReference & SoftReference, which started to circularly
reference themselves starting with Android API 17.

I'm reopening this because the app developer can't do much to defend
himself against this, and it's an ugly crash.

googl...@googlecode.com

unread,
Feb 27, 2013, 9:43:47 PM2/27/13
to google-gson...@googlegroups.com

Comment #20 on issue 440 by sourabh....@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I am having the same issue for API 15 as well. Worked fine on API 8.
I tried using Gson 1.7 with API 15
but I got the error as shown in the attached log file



Attachments:
log.txt 4.3 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

googl...@googlecode.com

unread,
Apr 18, 2013, 4:35:40 AM4/18/13
to google-gson...@googlegroups.com

Comment #21 on issue 440 by IsenGrim...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

In .NET, you are not allowed to serialize/deserialize complexe objects that
might recur into itself. Runtime exception is thrown when
serialization/deserialization of such objects are attempted.

IMO, you should disallow this use case. Or specify a max recursion level to
serialize/deserialize into.

googl...@googlecode.com

unread,
Apr 19, 2013, 12:59:18 PM4/19/13
to google-gson...@googlegroups.com

Comment #22 on issue 440 by d...@aylanetworks.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

This turn out to be the declaration of android.os.Handler in the
deserialization class.

googl...@googlecode.com

unread,
May 1, 2013, 3:27:41 PM5/1/13
to google-gson...@googlegroups.com

Comment #23 on issue 440 by Alain.Vi...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

In case this help narrow the problem, I solved the problem by following Zar
answer on http://stackoverflow.com/a/14572063/279565.

I had added at some point a member
private LogCentral log = LogCentral.getInstance();

LogCentral being a singleton, (not related to Log4j or smilar). Just a
plain simple filewriter class.

Making the member static solves the problem, although I don't know why.

googl...@googlecode.com

unread,
Sep 9, 2013, 6:19:56 AM9/9/13
to google-gson...@googlegroups.com

Comment #24 on issue 440 by kereno...@gmail.com: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

this bug is reproducable with this simple class
public class Prepare {

private ScheduledThreadPoolExecutor downloadJobExecutorPool;
public static void main(String... arguments) throws Exception {
Prepare stService = new Prepare();
System.out.println(stService.toJson());
}
public String toJson(){
Gson gson = new Gson();
return gson.toJson(this);
}

}

have a ScheduledThreadPoolExecutor in your class and this bug happens in
2.2.2 and 2.2.4 but not in 1.7.1

googl...@googlecode.com

unread,
Oct 3, 2013, 7:30:38 PM10/3/13
to google-gson...@googlegroups.com

Comment #25 on issue 440 by martin.j...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I reproduced this error in the following use case: I have a series of
objects that use a generic fluent pattern, i.e.

public MyAbstractClass<M extends MyAbstractClass> {
private int value;
public M setValue(int value) {
this.value = value;
return (M) this;
}
}

public MyImpl extends MyAbstractClass<MyImpl> {
private int foo;
public MyImpl setSomethingElse(int foo) {
this.foo = foo;
}
}

public static void main(String... args) {
MyImpl impl = new MyImpl();
myImpl.setValue(1)
.setSomethingElse(foo);
}

I'm not really griping that this error happens so much as:

1) It's difficult to diagnose exactly where the problem is
2) The object that I was serializing had a registered type adapter for it's
INTERFACE, like:

public MyOuterClass implements SomeInterface {
private MyImpl impl;
// etc.
}

then:

gsonBuilder.registerTypeAdapter(SomeInterface.class,
someInterfaceTypeAdapter);

Where someInterfaceTypeAdapter doesn't call anything on the MyImpl
argument. What I'm saying is, it shouldn't have this hangup when there's a
type adapter that's supposed to handle the job. I fixed the problem by
doing:

gsonBuilder.registerTypeAdapter(MyOuterClass.class,
someInterfaceTypeAdapter);

Gson should be smart enough to realize it doesn't have to go through the
trouble of reading all the fields if there is an appropriate type adapter.

googl...@googlecode.com

unread,
Nov 2, 2013, 7:02:02 PM11/2/13
to google-gson...@googlegroups.com

Comment #26 on issue 440 by MichaelA...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

11-03 00:57:31.998: E/AndroidRuntime(7980): FATAL EXCEPTION: main
11-03 00:57:31.998: E/AndroidRuntime(7980): java.lang.StackOverflowError
11-03 00:57:31.998: E/AndroidRuntime(7980): at
java.lang.String._getChars(String.java:903)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:147)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
java.lang.StringBuffer.append(StringBuffer.java:219)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
java.io.StringWriter.write(StringWriter.java:147)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
java.io.StringWriter.append(StringWriter.java:199)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
java.io.StringWriter.append(StringWriter.java:30)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.stream.JsonWriter.beforeValue(JsonWriter.java:626)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.stream.JsonWriter.open(JsonWriter.java:325)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.stream.JsonWriter.beginObject(JsonWriter.java:308)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:190)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
11-03 00:57:31.998: E/AndroidRuntime(7980): at
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
11-03 00:57:31.998: E/AndroidRuntime(7980): a


Same here.

googl...@googlecode.com

unread,
Nov 4, 2013, 3:03:21 AM11/4/13
to google-gson...@googlegroups.com

Comment #27 on issue 440 by ahmad.m...@exalt.ps: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

on Version 2.2.3
I have same issue cause my model implements Comparable of its type:
class X implements Comparable<X>{
// members ...

// @NOTE: this has a problem when down grading to 1.7.1
Map<String, Object> parameters;

}

when I downgraded to version 1.7.1 the parameters map is not deserialized
correctly if I received a String for the value, this will save the key
correctly but the String value is saved as object and when trying to cast
it back to string It will throw an exception.

googl...@googlecode.com

unread,
Nov 26, 2013, 10:37:47 AM11/26/13
to google-gson...@googlegroups.com

Comment #28 on issue 440 by andre.w...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I had the same problem. Turned out that my model classes parent class had a
field that was not marked as transient but definitely should have been.
This was not an issue with Android 4.0.4 but it is under 4.3.

googl...@googlecode.com

unread,
Mar 29, 2014, 6:40:07 PM3/29/14
to google-gson...@googlegroups.com

Comment #29 on issue 440 by inder123: Infinity loop at recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

Issue 554 has been merged into this issue.

googl...@googlecode.com

unread,
Apr 6, 2014, 8:13:22 PM4/6/14
to google-gson...@googlegroups.com

Comment #30 on issue 440 by mat...@weheartit.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

Same issue here with Objects containing WeakReferences. Because I didn't
need that particular ivar to be serialized, I circumvented this problem by
applying the transient flag.

googl...@googlecode.com

unread,
May 13, 2014, 1:57:08 PM5/13/14
to google-gson...@googlegroups.com

Comment #31 on issue 440 by jeremyvillalobos: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I lowered gson to 1.7.2 as noted on:
http://stackoverflow.com/questions/14565647/gson-2-2-2-causing-a-stackoverflow-on-4-2-1-only
And that solved the problem for my project.

googl...@googlecode.com

unread,
Jun 20, 2014, 12:26:24 AM6/20/14
to google-gson...@googlegroups.com

Comment #32 on issue 440 by strukac...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I solved this problem like this http://stackoverflow.com/a/24319892/1411598

googl...@googlecode.com

unread,
Jul 2, 2014, 5:18:44 AM7/2/14
to google-gson...@googlegroups.com

Comment #33 on issue 440 by MMaximil...@gmail.com: Infinity loop at
recursive calling
com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

confirm on gson 2.2.4 (android api 17-19) with WeakReference. Making
field "transient" solves problem (or you can try @Expose)

googl...@googlecode.com

unread,
Aug 13, 2014, 4:12:39 PM8/13/14
to google-gson...@googlegroups.com

Comment #34 on issue 440 by ailton.mizuki: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
http://code.google.com/p/google-gson/issues/detail?id=440

I solve this problem realizing interface Serializable. Each class has to be
realized this interface

googl...@googlecode.com

unread,
Aug 29, 2014, 10:38:21 AM8/29/14
to google-gson...@googlegroups.com

Comment #35 on issue 440 by gdubi...@bidlab.pl: Infinity loop at recursive
calling com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
https://code.google.com/p/google-gson/issues/detail?id=440

I too had this problem and I solved it ..by realizing I was trying to
serialize the wrong class - my service class ("this") instead of my model
class. ^_^'

(But I think it was the logger blocking serialization of my service class -
see http://stackoverflow.com/a/14572063/2693875)
Reply all
Reply to author
Forward
0 new messages