Announcement Announcement Module
Collapse
No announcement yet.
Is Boostrap.groovy invoked when a grails war is deployed? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is Boostrap.groovy invoked when a grails war is deployed?

    I had assumed it was - but I don't see my seed data in the database.

    Bootstrap is run successfully (I see the seed data in the database) when using run-app.

    If not, is there a way to make it run?

  • #2
    It is run in all environments. Simple enough to test - just add a println in the init closure.

    Comment


    • #3
      In addition, I find it useful to enable exceptions for failed validation in BootStrap:
      Code:
      class BootStrap {
          def init = {
              def a = new Author().save(failOnError: true)
              ...
          }
      }
      You'll then know pretty quickly if validation errors are preventing your data from being saved to the database.

      Comment


      • #4
        Of course, it was due to invalid seed data.

        Thanks for the failOnError tip.

        Comment

        Working...
        X