Search code examples
grailsubuntutomcat6elasticsearch

Grails start up error: groovy.lang.Closure.rehydrate(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lgroovy/lang/Closure;


I'm getting the following error when starting a Grails 2.1.0 app on Tomcat 6 / Ubuntu 12.04.

Error 500 - Internal Server Error.

groovy.lang.Closure.rehydrate(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lgroovy/lang/Closure;

This app runs fine using run-app in STS 3.0 on Windows 7 and also using Tomcat6 on Windows.

I've deployed the war manually.

I've seen a similar issue reported for an app deployed to Cloud Foundry: Error 500: Closure.rehydrate at deploying grails app on cloud foundry but nothing there is giving me any clues.

The app has worked fine previously. I've made a number of code changes recently, including installing the ElasticSearch plugin but the error in the logs is referring to building the views from the gsps.

INFO: Initializing Spring FrameworkServlet 'grails'
17-Sep-2012 11:34:47 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet grails threw exception
java.lang.NoSuchMethodError: groovy.lang.Closure.rehydrate(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lgroovy/lang/Closure;
    at org.codehaus.groovy.grails.web.taglib.GroovyPageTagBody.<init>(GroovyPageTagBody.java:65)
    at org.codehaus.groovy.grails.web.taglib.GroovyPageTagBody.<init>(GroovyPageTagBody.java:49)
    at org.codehaus.groovy.grails.web.pages.GroovyPage.createTagBody(GroovyPage.java:630)
    at org.codehaus.groovy.grails.web.pages.GroovyPage$createTagBody.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
    at gsp_bipboxindex_gsp.run(index.gsp:4)

Any clues much appreciated!


Solution

  • Closure.rehydrate was introduced in Groovy 1.8.5 . It looks like there is an older version of groovy in the war. Check the WEB-INF/lib directory inside your war file to see if it contains an duplicate and older version of groovy.