Announcement Announcement Module
Collapse
No announcement yet.
hotdeploy of grails services Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • hotdeploy of grails services

    Hello,

    I am wondering why hot deployment of grails services is not supported yet. This would be very handy for grails apps that implement most of logic in the service tier. Right now it is quite tiring to restart entire app to see changes made in services classes.

    Is this feature on the Grails roadmap or there is a significant technical obstacle that makes it difficult to do.

    Can someone shed some light on this please?

    Thanks,
    Klekot

  • #2
    It should work, but it does depend on what kind of dependencies the services have. Also, it's best to declare service injection points with 'def' rather than the type, i.e.
    Code:
    class MyController {
        def securityService
        ...
    }
    rather than
    Code:
    class MyController {
        SecurityService securityService
        ...
    }
    Sometimes the reloading does break down, but we don't really understand why. Note that runtime reloading of classes will get a boost for 1.4.

    Comment


    • #3
      Originally posted by pledbrook View Post
      rather than
      Code:
      class MyController {
          SecurityService securityService
          ...
      }
      Ach probably that is why it was not working for me as I always inject using type, I do that because STS can help me then with code completion for the type being injected.
      If I inject using def I do not get any code completion relevant for injected type which is really bad.

      Thanks for clarification on this. BTW will this be improved in 1.4? Using typed injection should not really break hot reloading.
      I can't really imagine building large grails app without IDE support for code completion for injected beans.


      Cheers,
      Klekot

      Comment


      • #4
        Hopefully 1.4 will improve this situation, but it depends on the underlying issues. We did get reloading with declared types working, but perhaps something broke later? Anyway, STS/IntelliJ may add auto-complete for injected beans in the future since they can infer the class in many cases.

        Comment


        • #5
          I miss the same. Services should be loaded hot!

          I was just struggling with the same thing. I'm still using 1.2.1, but this alone might convince me to upgrade grails.

          I am using def in my controller for the service, but its annoying that I have to restart the server for changes in my services.

          Also, i have intellij, but I get no auto-complete with my services in my controllers.

          Comment


          • #6
            I'm not really keeping track of IntelliJ, but you probably won't get auto-completion unless you statically type your service properties.

            Services are designed to support hot-reloading and in simple cases this works fine. Unfortunately, for unknown reasons this breaks down in other cases.

            Comment

            Working...
            X