Hi,

I believe this bug is already fixed in trunk. If I'm right, the
problem was missing conversion from JInt to float. You could fix it by
changing these values "passMarkApplied":0,"thresholdApplied":0 to
"passMarkApplied":0.0,"thresholdApplied":0.0

But it would be great if you have time to test with latest snapshot.
It worked for me at least.

Cheers Joni

On Feb 11, 6:11 pm, GA <my_li...@me.com> wrote:
> Hello guys,
>
> I am having a very strange error parsing JSON messages. Everything was 
> working perfect until I introduce a new array in the message. It supposed to 
> be a very small change, but the system seems to be parsing java data types 
> instead of scala data types.
>
> This is the error message:
>
> net.liftweb.json.MappingException: Parsed JSON values do not match with class 
> constructor
> args=129567,248,1,1,0,0, String
> arg 
> types=java.lang.Long,java.lang.Long,java.lang.Long,java.lang.Long,scala.BigInt,scala.BigInt,java.lang.String
> constructor=public 
> com.tribes.ga.api.FeedAPI$FilterLogging$2(long,long,long,long,float,float,java.lang.String)
>
> I do not know how to solve this. There is another array in the same structure 
> that works just fine.
>
> This is the JSON message coming into the API:
>
> {"lastSync":"Thursday, February11,2010",
> "tribeId":1,
> "filterLogging":[{"passMarkApplied":0,"thresholdApplied":0,"entryId":129567,"evaluationDescription":"String","objectFiltered":1,"filterApplied":1,"sourceId":248}],
> "history":7,
> "deviceId":1036,
> "source":248,
> "showNews":true,
> "userId":1049,
> "syncFlag":false,
> "showNewsChanged":false,
> "updatedFeeds":[]}
>
> The error is with the array "filter". I am parsing it with the following code 
> (this is an extraction of the entire definition):
>
>             case class FilterLogging(entryId: Long,
>                                      sourceId: Long,
>                                      objectFiltered: Long,
>                                      filterApplied: Long,
>                                      passMarkApplied: Float,
>                                      thresholdApplied: Float,
>                                      evaluationDescription: String
>             )
>
>             case class UpdatedSource(userId: Long,
>                                      deviceId: Long,
>                                      tribeId: Long,
>                                      syncFlag: Boolean,
>                                      lastSync: String,
>                                      history: Int,
>                                      source: Long,
>                                      updatedFeeds: List[UpdatedFeeds],
>                                      filterLogging: List[FilterLogging]
>             )
>
>             val json = parse(req.body.map(bytes => new String(bytes, 
> "UTF-8")) openOr "")
>             val request: UpdatedSource = json.extract[UpdatedSource]
>
> Any ideas?
>
> Thanks in advance,
>
> GA

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to