Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paper trapped in recursive calls #11

Closed
albertdatui opened this issue Jul 14, 2015 · 4 comments
Closed

Paper trapped in recursive calls #11

albertdatui opened this issue Jul 14, 2015 · 4 comments

Comments

@albertdatui
Copy link

Hi guys, is there anybody who can help me with this error?
I suspect it is trapped in recursive calls. any idea how to fix this?

07-14 00:03:44.102  24180-24180/com.application.android.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.application.android.myapplication, PID: 24180
    java.lang.StackOverflowError
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
            at com.esotericsoftware.kryo.io.Output.flush(Output.java:181)
            at com.esotericsoftware.kryo.io.OutputChunked.flush(OutputChunked.java:63)
            at com.esotericsoftware.kryo.io.Output.require(Output.java:160)
            at com.esotericsoftware.kryo.io.Output.writeBytes(Output.java:246)
            at com.esotericsoftware.kryo.io.Output.write(Output.java:214)
    at
@pilgr
Copy link
Owner

pilgr commented Jul 14, 2015

Make sure your object graph doesn't have cyclic dependencies. Also you can exclude fields which cause such error using transient.

@pilgr
Copy link
Owner

pilgr commented Jul 22, 2015

Have you had an cyclic dependencies which are not supported by Paper? Can we close the issue then?

@albertdatui
Copy link
Author

hi..
I am not sure whether the object has cyclic dependencies because I am trying to save Resource object in android. Any Idea?

@pilgr
Copy link
Owner

pilgr commented Jul 22, 2015

Resource is an system runtime object, definitely it may contain cyclic dependencies. You shouldn't use Paper to save Context, Resources, PendingIntent and other system runtime objects. Paper purpose is to save your data objects. If you have reference to Resource in saved classes (which is looks bad) you can avoid saving them using transient fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants