This is a copy-paste problem. If you copy the text first to a standard
text editor (like notepad), you'll see
"def xwiki" and "def context" are in the same line, unfortunately
this
is not actually allowed by the groovy parser UNLESS you put a ";" after
each line (it's only the first two lines of the class that has this
problem for the example).
I'll add some text to the example to highlight this.
-----Original Message-----
From: roopesh(a)digitalglue.in [mailto:roopesh@digitalglue.in]
Sent: 24 April 2007 08:20
To: xwiki-users(a)objectweb.org
Subject: [xwiki-users] Groovy tutorial in dev guide
Hi
I tried to follow the Groovy Tutorial given in the developer guide. But
I couldn't make it run.
(
http://www.xwiki.org/xwiki/bin/view/DevGuide/GroovyClassHelloWorldTutor
ial)
Instantiating groovy class from velocity threw the foll error :
Error number 4001 in 4: Error while parsing velocity page
Main.HelloWorldFromVelocity Wrapped Exception: Invocation of method
'parseGroovyFromPage' in class com.xpn.xwiki.api.XWiki threw exception
com.xpn.xwiki.XWikiException: Error number 14001 in 14: Failed compiling
groovy script Wrapped Exception: startup failed,
script1177398554781.groovy: 5: unexpected token: xwiki @ line 5, column
5.
Instantiating groovy from groovy resulted in the foll error :
Error number 4002 in 4: Error while parsing groovy page
Groovy.HelloWorldClassTest Wrapped Exception: startup failed,
Script1.groovy: 3: unexpected token: groovyObject @ line 3, column 68.
(While creating the class I have assigned programming rights to the user
who made the class.) What am I doing wrong.
Thanks and Regards
Roopesh