bowler-framework / Bowler

RESTful Web Framework based on Scala, built on top of Scalatra & Scalate
http://bowlerframework.org
BSD 3-Clause "New" or "Revised" License
119 stars 13 forks source link

JSON arbitrarily renders empty json on persistent objects #3

Closed wfaler closed 13 years ago

wfaler commented 13 years ago

It seems that the JSON renderer arbitrarily renders empty JSON objects some of the time for case classes that are retrieved from a persistent store with JPA or Squeryl.

The two common denominators seem to be:

I initially thought it was the no-args constructor that was the issue, but it seems that it is a mix of the issues that somehow collude - no-args constructors are fine on non-persistent objects.

This is probably a lift-json library issue, however if that is the case, maybe replacing it is an option with another implementation of JsonViewRenderer

wfaler commented 13 years ago

This is a confirmed issue in lift-json. A fix and a pull request has been issued: https://github.com/lift/lift/pull/3, as well as a ticket raised: http://www.assembla.com/spaces/liftweb/tickets/922-lift-json-occassionally-chooses-the-wrong-constructor--resulting-in-erroneous-serialization

In the interim, I have renamed the lift-json artifact and published it myself, and this will be used by Bowler until the next release of lift-json becomes available with the fix.

wfaler commented 13 years ago

closing