Extraction.decompose throws exception (java.lang.NoClassDefFoundError: com/thoughtworks/paranamer/ParameterNamesNotFoundException)

949 views
Skip to first unread message

parsa

unread,
Jun 26, 2011, 11:36:38 AM6/26/11
to Lift
Hi folks,

I'm trying to serialize a Map in json format using lift-json. Here's
what I do:

scala> :cp lift-json_2.8.1-2.3.jar
Added 'cp lift-json_2.8.1-2.3.jar'. Your new classpath is:
.:lift-json_2.8.1-2.3.jar

scala> implicit val formats = net.liftweb.json.DefaultFormats
formats: net.liftweb.json.DefaultFormats.type =
net.liftweb.json.DefaultFormats$@1181a6d

scala> import net.liftweb.json.JsonAST._
import net.liftweb.json.JsonAST._

scala> import net.liftweb.json.Extraction._
import net.liftweb.json.Extraction._

scala> import net.liftweb.json.Printer._
import net.liftweb.json.Printer._

scala> decompose(Map("a"->"b"))
java.lang.NoClassDefFoundError: com/thoughtworks/paranamer/
ParameterNamesNotFoundException
at net.liftweb.json.Extraction$.gd1$1(Extraction.scala:75)
at net.liftweb.json.Extraction$.decompose(Extraction.scala:73)
at .<init>(<console>:9)
at .<clinit>(<console>)
at RequestResult$.<init>(<console>:9)
at RequestResult$.<clinit>(<console>)
at RequestResult$scala_repl_result(<console>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$anonfun
$apply$17.apply(Interpreter.scala:988)
at scala...

Can someone tell me what's going on here? Thanks.

TylerWeir

unread,
Jun 26, 2011, 1:16:43 PM6/26/11
to lif...@googlegroups.com
You need paranamer,jar in your classpath.

Dump below:

[ ~/g/im-q/synqer/lib_managed/scala_2.9.0-1/compile ] [ master ]
>> ls
activation-1.1.jar              derby-10.7.1.1.jar              joda-time-1.6.2.jar             lift-db_2.9.0-1-2.4-M1.jar      lift-proto_2.9.0-1-2.4-M1.jar   lift-webkit_2.9.0-1-2.4-M1.jar  scalap-2.9.0-1.jar
commons-codec-1.4.jar           h2-1.2.147.jar                  lift-actor_2.9.0-1-2.4-M1.jar   lift-json_2.9.0-1-2.4-M1.jar    lift-textile_2.9.0-1-2.4-M1.jar mail-1.4.1.jar                  slf4j-api-1.6.1.jar
commons-fileupload-1.2.2.jar    htmlparser-1.2.1.jar            lift-common_2.9.0-1-2.4-M1.jar  lift-mapper_2.9.0-1-2.4-M1.jar  lift-util_2.9.0-1-2.4-M1.jar    paranamer-2.3.jar
[ ~/g/im-q/synqer/lib_managed/scala_2.9.0-1/compile ] [ master ]
>> scala -cp "*.jar:
[ ~/g/im-q/synqer/lib_managed/scala_2.9.0-1/compile ] [ master ]
>> scala -cp "*.jar"
Welcome to Scala version 2.9.0.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.

scala>  implicit val formats = net.liftweb.json.DefaultFormats 
formats: net.liftweb.json.DefaultFormats.type = net.liftweb.json.DefaultFormats$@7ab128a2

scala>  import net.liftweb.json.JsonAST._ 
import net.liftweb.json.JsonAST._

scala>  import net.liftweb.json.Extraction._ 
import net.liftweb.json.Extraction._

scala>  import net.liftweb.json.Printer._ 
import net.liftweb.json.Printer._

scala>  decompose(Map("a"->"b")) 
res0: net.liftweb.json.package.JValue = JObject(List(JField(a,JString(b))))

parsa

unread,
Jun 27, 2011, 9:24:33 AM6/27/11
to Lift
Much appreciated, it's worth mentioning in lift-json's README (on
GitHub).

TylerWeir

unread,
Jun 27, 2011, 9:26:49 AM6/27/11
to lif...@googlegroups.com
I think the error message is perfectly clear.
Reply all
Reply to author
Forward
0 new messages