liftjson unexpected error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

liftjson unexpected error

alanP
Hi,

I'm a complete newbie here so I may be doing something stupid, but I didn't expect the error below. I'm using latest dispatch and net.liftweb.json libs (latter from 2.3-M1 release). Any hint?

Thanks in advance,

Alan


scala> import dispatch._
import dispatch._

scala> import Http._
import Http._

scala> import dispatch.liftjson._
import dispatch.liftjson._

scala> import dispatch.liftjson.Js._
import dispatch.liftjson.Js._

scala> val http = new Http
http: dispatch.Http = dispatch.Http@42d6f8f6

scala> val db = :/("databinder.net")
db: dispatch.Request = dispatch.Request@38ad8817

scala> http(db / "couch/dispatch/Stdout%20Walkthrough" as_pretty)
INF: [console logger] dispatch: GET http://databinder.net/couch/dispatch/Stdout%20Walkthrough
java.lang.IncompatibleClassChangeError: Class net.liftweb.json.JsonDSL$ does not implement the requested interface net.liftweb.json.Printer
        at dispatch.liftjson.Js$JsonRequest$$anonfun$as_pretty$1.apply(LiftJson.scala:19)
        at dispatch.liftjson.Js$JsonRequest$$anonfun$as_pretty$1.apply(LiftJson.scala:19)
        at dispatch.liftjson.Js$JsonRequest$$anonfun$$greater$hash$1.apply(LiftJson.scala:18)
        at dispatch.liftjson.Js$JsonRequest$$anonfun$$greater$hash$1.apply(LiftJson.scala:18)
        at dispatch.Handlers$$anonfun$$greater$minus$1.apply(Http.scala:325)
        at dispatch.Handlers$$anonfun$$greater$minus$1.apply(Http.scala:325)
        at dispatch.Handlers$$anonfun$$greater$tilde$1.apply(Http.scala:320)
        at dispatch.Handlers$$anonfun$$greater$tilde$1.apply(Http.scala:319)
        at dispatch.Handlers$$anonfun$$great...
scala>
Reply | Threaded
Open this post in threaded view
|

Re: liftjson unexpected error

alanP
Just a note...the code below does *not* produce any error, while it seems to me to be just a simple expansion of the code that triggered the exception:

scala> http(db / "couch/dispatch/Stdout%20Walkthrough" ># (js => pretty(render(js))))  //works

scala> http(db / "couch/dispatch/Stdout%20Walkthrough" as_pretty)  //IncompatibleClassChangeError

Thanks,

Alan