Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Huge List of Exceptions on generate() #54

Open
scan opened this issue Apr 14, 2012 · 0 comments
Open

Huge List of Exceptions on generate() #54

scan opened this issue Apr 14, 2012 · 0 comments

Comments

@scan
Copy link

scan commented Apr 14, 2012

I'm having this code:

import play.api.Play.current
import java.util.{Date}
import play.api.libs.json._
import com.codahale.jerkson.Json._

case class Profile(id: String,
                   displayName: Option[String] = None,
                   public: Boolean = false,
                   nsfw: Boolean = false,
                   created: Date = new Date,
                   meta: Map[String, String] = Map.empty) {
    lazy val asJson = generate(this)
}

When I try to evaluate the asJson, I get a load of exceptions, and +2GB of RAM usage. The list so long that I can't get the beginning because the console logs are cut off. Here is a snippet from the beginning, they're the same over and over:


java.lang.reflect.InvocationTargetException: null
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_03]
    at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_03]
    at com.codahale.jerkson.ser.CaseClassSerializer.serialize(CaseClassSerializer.scala:33) ~[jerkson_2.9.1-0.5.0.jar:na]
    at com.codahale.jerkson.ser.CaseClassSerializer.serialize(CaseClassSerializer.scala:12) ~[jerkson_2.9.1-0.5.0.jar:na]
    at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610) ~[jackson-mapper-asl-1.9.6.jar:1.9.6]
org.codehaus.jackson.map.JsonMappingException: [no message for java.lang.reflect.InvocationTargetException]
    at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:625) ~[jackson-mapper-asl-1.9.6.jar:1.9.6]
    at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256) ~[jackson-mapper-asl-1.9.6.jar:1.9.6]
    at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1613) ~[jackson-mapper-asl-1.9.6.jar:1.9.6]
    at org.codehaus.jackson.impl.JsonGeneratorBase.writeObject(JsonGeneratorBase.java:314) ~[jackson-core-asl-1.9.6.jar:1.9.6]
    at com.codahale.jerkson.Generator$class.generate(Generator.scala:43) ~[jerkson_2.9.1-0.5.0.jar:na]
    at com.codahale.jerkson.Generator$class.generate(Generator.scala:20) ~[jerkson_2.9.1-0.5.0.jar:na]

This also persists when I remove the Map field, so it's not linked to that other issue.

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

No branches or pull requests

1 participant