1

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 ?

Tegi
  • 768
  • 8
  • 14

2 Answers2

0

In Grails 2.3 reloading is enabled using the grails command:

grails -reloading run-app

Or you can set

grails.reload.enabled = true

in BuildConfig.groovy

Both these approaches are not perfect. Look here for more reference:

https://grails.org/Auto+Reloading

Grails 2.3.0 Auto-reloading not working

Community
  • 1
  • 1
Yash Agarwal
  • 955
  • 1
  • 13
  • 28
  • I have reloading enabled, it works in most cases. I've also noticed the remark in the documentation about typed vs untyped injection, and I've tried both, but neither worked. – Tegi Jul 22 '14 at 11:33
0

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

vishesh
  • 2,007
  • 6
  • 32
  • 67
  • This is interesting. It works as expected, but throws the following error: `Plugin [services:2.3.8] could not reload changes to file [/SomeService.groovy]: Cannot get property 'cacheOperationSource' on null object [ERROR][org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager]` – Tegi Jul 28 '14 at 12:41