MongoDB Plugin
  1. MongoDB Plugin
  2. GPMONGODB-21

Embedded class defined in same file as parent results in NPE when saving parent object

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.RC2
    • Labels:
      None

      Description

      java.lang.NullPointerException
         at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:139)
         at org.grails.datastore.gorm.GormEnhancer$1.call(GormEnhancer.groovy:93)
         at demo1.CustomerController$_closure4.doCall(CustomerController.groovy:24)
         at demo1.CustomerController$_closure4.doCall(CustomerController.groovy)
         at java.lang.Thread.run(Thread.java:680)
      

      Customer.groovy:

      class Customer {
         String name
         Address address
         static embedded = ['address']
      }
      
      class Address {
         String street
      }
      


      Moving Address to its own file fixes the problem.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Burt Beckwith
            Reporter:
            Chris Richardson
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: