Details
Description
Since I have upgraded to 1.3.1, it seems while running my grails application in development mode, I cannot modify anymore some of my services during runtime.
If I do change the service file, I got the following error :
Caused by: java.lang.ClassCastException: com.irofoot.VoteService cannot be cast to com.irofoot.VoteService
at com.irofoot.VoteService$$FastClassByCGLIB$$e974f44.invoke(<generated>![]()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at com.irofoot.VoteService$$EnhancerByCGLIB$$21cefb3d.getMetaClass(<generated>![]()
at com.irofoot.VisualizationService.getGoogleChartUrl(VisualizationService.groovy:19)
at GrailsMelodyGrailsPlugin$_closure5_closure18_closure19.doCall(GrailsMelodyGrailsPlugin.groovy:136)
at com.irofoot.VizuTagLib$_closure3.doCall(VizuTagLib.groovy:21)
... 10 more
This is quite annoying because I need to restart the application in dvt mode each time I need to change a Service class!!
-
Hide
- try6.1.zip
- 06/Jun/10 7:21 PM
- 252 kB
- Fabien Benichou
-
- try6/.classpath 0.7 kB
- try6/.project 0.5 kB
- try6/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- try6/application.properties 0.2 kB
- try6/grails-app/conf/BootStrap.groovy 0.1 kB
- try6/grails-app/conf/BuildConfig.groovy 1 kB
- try6/grails-app/conf/Config.groovy 3 kB
- try6/grails-app/conf/DataSource.groovy 0.6 kB
- try6/grails-app/.../spring/resources.groovy 0.0 kB
- try6/grails-app/conf/UrlMappings.groovy 0.2 kB
- try6/grails-app/.../OneController.groovy 0.1 kB
- try6/grails-app/i18n/messages.properties 3 kB
- try6/grails-app/.../messages_da.properties 3 kB
- try6/grails-app/.../messages_de.properties 4 kB
- try6/grails-app/.../messages_es.properties 3 kB
- try6/grails-app/.../messages_fr.properties 2 kB
- try6/grails-app/.../messages_it.properties 2 kB
- try6/grails-app/.../messages_ja.properties 2 kB
- try6/grails-app/.../messages_nl.properties 3 kB
- try6/.../messages_pt_BR.properties 3 kB
- try6/.../messages_pt_PT.properties 3 kB
- try6/grails-app/.../messages_ru.properties 4 kB
- try6/grails-app/.../messages_th.properties 5 kB
- try6/.../messages_zh_CN.properties 2 kB
- try6/grails-app/.../try6/OneService.groovy 0.3 kB
- try6/grails-app/.../OneServiceService.groovy 0.1 kB
- try6/grails-app/views/error.gsp 2 kB
- try6/grails-app/views/index.gsp 3 kB
- try6/grails-app/views/layouts/main.gsp 0.7 kB
- try6/target/.../application.properties 0.2 kB
Issue Links
- is depended upon by
-
GPSPRINGCACHE-8
Classes with @Cacheable on methods (i.e. services but not controllers) are not reloadable
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Please attach a project with a service class that exhibits this behaviour on reload.
Project attached. Just run "grails run-app", then go to the unique controller to see that it is working fine. Then go to the unique service, change something in OneService code, save, refresh browser => BOOM ! (com.try6.OneService cannot be cast to com.try6.OneService)
I am also having this issue, including in inline plugins I work with (seeing the issue as late as 1.3.4 and 1.3.5). I do not use @Transactional.
If anybody has any ideas as to what it might be, let me know - I can gave some guys on my team spend some time looking at it, but not sure where to start.
I have re-opened https://jira.springsource.org/browse/SPR-4153 as it is the root cause. I have also proposed a workaround in Grails until the Spring issue is fixed. If approved, this will be fixed in 1.3.6.
Note: the ?aop-reloading-fix? plugin can be installed in earlier versions of Grails to fix this issue.
I've just tried the plugin on grails 1.3.1, and was getting the following:
Plugin aop-reloading-fix-0.1 requires version [* < 1.3.5] of Grails which your current Grails installation does not meet. Please try install a different version of the plugin or Grails.
I hacked the Ivy zip to use use the following: 1.2-M3 > * and it seemed to install ok. The grails version currently defined is:
def grailsVersion = "* > 1.3.5"
which I guess is incorrect?
The plugin is not working for Spring Security ACL annotations. Any ideas? Thank you!
It might be related to the annotation @Transactional. I need to test it but it seems that this exception occurs when a service has a method having the @Transactional annotation defined. Other services without this annotation seems to work just fine