2

I have a Groovy service ReportService.groovy inside grails-app/services.

When I make some changes in the file, console output is:

File /home/username/project/grails-app/services/com/company/ReportService.groovy changed, recompiling...
Spring Loaded: Cannot reload new version of com.company.ReportService
Reason: Interfaces changed from [groovy/lang/GroovyObject, grails/artefact/Service, grails/events/Events$Trait$FieldHelper] to [grails/artefact/Service, grails/plugins/mail/SendMail, grails/plugins/mail/SendMail$Trait$FieldHelper, grails/events/Events$Trait$FieldHelper, groovy/lang/GroovyObject]

Hence, the changes are not seen immediately. And, I have to restart the application again and again to view the changes.

How can I view the reloading effect immediately in the application for Service classes?

Similar case was reported as issue but for java classes only. (https://github.com/grails/grails-core/issues/9047)

tim_yates
  • 167,322
  • 27
  • 342
  • 338
sgiri
  • 691
  • 12
  • 28
  • Hi @sgiri, you have this problem on every edit, or only when you change something specific? E.g. if you change a variable assignment, you have this? – lifeisfoo Jun 23 '16 at 11:39
  • @lifeisfoo Problem is in every edits. If I edit a Service which implements `WebAttributes` from `grails.web.api` package, I get this message `Reason: Interfaces changed from [grails/web/api/WebAttributes, groovy/lang/GroovyObject, grails/web/api/WebAttributes$Trait$FieldHelper, grails/artefact/Service, grails/events/Events$Trait$FieldHelper] to [grails/web/api/WebAttributes, grails/web/api/WebAttributes$Trait$FieldHelper, grails/artefact/Service, grails/plugins/mail/SendMail, grails/plugins/mail/SendMail$Trait$FieldHelper, grails/events/Events$Trait$FieldHelper, groovy/lang/GroovyObject]` – sgiri Jun 23 '16 at 13:01
  • Is this only happening with the service that `implements WebAttributes`? Or do you have the same issue with your other normal services (that don't `implement` anything)? – Ian Jun 28 '16 at 21:26
  • @Ian for normal services as well. – sgiri Jun 29 '16 at 08:17

1 Answers1

1

This was a known bug around grails 3.1.5 - 3.1.7. It has been fixed since grails 3.1.8. Also, for auto-reloading to work, you have to be using the 'development' environment via the grails run-app command.

fcnorman
  • 1,154
  • 9
  • 19
  • Would you be able to provide any JIRA tickets for the Grails framework that show this? (not that I don't trust you, just so we can see the details) – Ian Sep 20 '16 at 13:49