[json-lib-user] Groovy Usage
Brought to you by:
aalmiray
From: John D <j0h...@ya...> - 2007-10-23 19:50:43
|
Hi,=0A=0AI'm trying to use json-lib from groovy for the first time and am u= nable to get even the simplest example to execute. Here's what I have:=0A= =0A<john:scripts >groovy -v=0AGroovy Version: 1.1-rc-1 JVM: 1.5.0_07-87=0A= =0A<john:scripts >cat test_json.groovy =0Aimport net.sf.json.groovy.JsonGro= ovyBuilder=0A=0Adef builder =3D new JsonGroovyBuilder()=0Adef books1 =3D bu= ilder.books {=0A book =3D [title: "The Definitive Guide to Grails", autho= r: "Graeme Rocher"]=0A book =3D [title: "The Definitive Guide to Grails",= author: "Graeme Rocher"]=0A}=0Aprintln books1=0A=0A=0A<john:scripts >groov= y test_json.groovy =0ACaught: net.sf.json.JSONException: null object=0A = at test_json.run(test_json.groovy:8)=0A at test_json.main(test_j= son.groovy)=0A=0A=0AAny ideas, am I doing something stupid?=0A=0AThanks,=0A= =0AJohn=0A=0A=0A |