Hi Mark, On May 26, 2011, at 9:59 PM, Mark Halvorson wrote:
> Question 1: > > I have two groovy scripts: > > api.model.Utility > > and > > api.model.apiDispactcher > > Inside apiDispatcher I have a routine that creates the Utility object: > > def util = new Utility() > > And calls a method on the Utility class. > > What I have found is that with that line in my code when I try to save > api.model.apiDispatcher I get the error: > > "api.model.apiDispatcher should declare at least one class named > apiDispatcher" I could track this one to http://nexus.magnolia-cms.com/content/sites/magnolia.public.sites/modules/magnolia-module-groovy/1.1/magnolia-module-groovy/xref/info/magnolia/module/groovy/support/classes/MgnlGroovyClassLoader.html#233 As for the reason ... I "think" you are saving the script with the dots in name, while Magnolia is looking for a package structure (i.e. for file "apiDispatcher" in folder "model" in folder "api") > > If I comment it out, the script will save (but not work): > > //def util = new Utility() > > Question 2: > > Has anyone else had problems with groovy scripts refreshing? It seems like I > need to restart Magnolia every time I make an edit. nope, never had that or heard of anyone having same issue. Perhaps there is some innocently looking message in your log file explaining what happens? If not I'd try to enable debug on info.magnolia.module.groovy and see if anything interesting appears in the logs. HTH, Jan ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
