Open amnaredo opened 3 years ago
Youre using the js version of upickle on the jvm On Oct 29, 2014 9:03 AM, "Mathieu" notifications@github.com wrote:
Hi, I use upickle through autowire in a scalatra client/server application. My server depends on JVM stuff (for autowire, upickle, ...) and my client one on JS stuff (for autowire, upickle, ...).
Everything compiles and runs fine, except when I do a request through autowire, I get a weird exeception when upickle reads the JSON data. Is some lib or something is missing ? Thanks
scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) at scala.scalajs.js.JSON$.parse$default$2(JSON.scala:33) at upickle.json.package$.read(package.scala:20) at upickle.Types$class.read(Types.scala:135) at upickle.package$.read(package.scala:10) at org.openmole.gui.server.core.GUIServlet$$anonfun$2.apply(GUIServlet.scala:69) at org.openmole.gui.server.core.GUIServlet$$anonfun$2.apply(GUIServlet.scala:65)
— Reply to this email directly or view it on GitHub https://github.com/lihaoyi/upickle/issues/38.
Original Author: lihaoyi
No, I do use upickle JVM for my server and upickle JS for my client ! It is the only explanation that can causes this kind of error according to you ?
Original Author: mathieuleclaire
Yeah, can't think of anything else. The stack trace is definitely showing upickle-JS methods I. A JVM stacktrace On Oct 29, 2014 9:28 AM, "Mathieu" notifications@github.com wrote:
No, I do use upickle JVM for my server and upickle JS for my client ! It is the only explanation that can causes this kind of error according to you ?
— Reply to this email directly or view it on GitHub https://github.com/lihaoyi/upickle/issues/38#issuecomment-60956221.
Original Author: lihaoyi
Well, from the stacktrace, we have:
at upickle.package$.read(package.scala:10) //it is in jvm: jvm/src/main/scala/upickle/json/package.scala, then
at upickle.Types$class.read(Types.scala:135) //it is in shared/main/scala/upickle/Types.scala and then
at upickle.json.package$.read(package.scala:20) //it is in js/src/main/scala/upickle/json/package.scala !!
So my first call is well to the jvm lib, and then after 2 calls in upickle, we are in js part ... is this behaviour normal !?
Original Author: mathieuleclaire
Can you come up with a minimal example without your funky servlet container? I bet when you do the problem will become self evident.
Original Author: lihaoyi
Closing due to inactivity
Original Author: lihaoyi
I had similar issue - turns out it is because jvm depends on js, which brings in all dependencies of js to jvm which includes js version of upickle. You can use projectDependencies to explicitly exclude js upickle from the classpath of jvm.
Original Author: shengc
Hi, I use upickle through autowire in a scalatra client/server application. My server depends on JVM stuff (for autowire, upickle, ...) and my client one on JS stuff (for autowire, upickle, ...).
Everything compiles and runs fine, except when I do a request through autowire, I get a weird exeception when upickle reads the JSON data. Is some lib or something is missing ? Thanks
ID: 38 Original Author: mathieuleclaire