grailsspring-loaded

Grails ReloadingException when changing a service method's name


I am using Grails 2.3.8

When I change a method's name in a service class, and try to invoke it I get an error similar to this:

org.springsource.loaded.ReloadException: ReloadableType.determineDispatcher(): expected com.SomeService$$EnhancerBySpringCGLIB$$a85275cb to be reloadable

Now I guess this is because the actual service class is being wrapped in spring's "enhancer" and this somehow makes it unreloadable, but I'm not exactly sure why, and I have not found any information concerning this.

Is there a workaround for this, or do I have to restart the application whenever I change a method's name ?


Solution

  • To fix the reloadable warnings in grails console, follow these steps:

    1. Download the springloaded-1.2.0 from here: http://search.maven.org/remotecontent?filepath=org/springframework/springloaded/1.2.0.RELEASE/springloaded-1.2.0.RELEASE.jar
    2. Copy this jar to grails-2.3.7/lib/org.springframework/springloaded/jars
    3. Edit grails-2.3.7/bin/startGrails file, search for AGENT_STRING and change the AGENT_STRING to point to it rather than the 1.1.5 included in the distribution. It should look like this:

      set AGENT_STRING=-javaagent:"%GRAILS_HOME:\=/%/lib/org.springframework/springloaded/jars/springloaded-1.2.0.RELEASE.jar" -noverify -Dspringloaded=\"%SPRINGLOADED_PARAMS%\"

    4. restart grails