java.lang.NullPointerException: Cannot get property 'identifier' on null object

nabble.com | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Grails User (Old Archive) - Problems with GSON plugin

    nabble.com | 6 months ago
    java.lang.NullPointerException: Cannot get property 'identifier' on null object

    Root Cause Analysis

    1. java.lang.NullPointerException

      Cannot get property 'identifier' on null object

      at grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty()
    2. grails.plugin.gson
      GrailsDomainSerializer.serialize
      1. grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty(GrailsDomainSerializer.groovy:66)
      2. grails.plugin.gson.adapters.GrailsDomainSerializer.eachUnvisitedProperty(GrailsDomainSerializer.groovy:51)
      3. grails.plugin.gson.adapters.GrailsDomainSerializer.serialize(GrailsDomainSerializer.groovy:27)
      3 frames
    3. Gson
      Gson$3.serialize
      1. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:70)
      2. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:63)
      3. com.google.gson.Gson.toJson(Gson.java:586)
      4. com.google.gson.Gson.toJsonTree(Gson.java:479)
      5. com.google.gson.Gson$3.serialize(Gson.java:140)
      5 frames
    4. grails.plugin.gson
      GrailsDomainSerializer.serialize
      1. grails.plugin.gson.adapters.GrailsDomainSerializer$_serialize_closure1.doCall(GrailsDomainSerializer.groovy:44)
      2. grails.plugin.gson.adapters.GrailsDomainSerializer$_eachUnvisitedProperty_closure2.doCall(GrailsDomainSerializer.groovy:59)
      3. grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty(GrailsDomainSerializer.groovy:70)
      4. grails.plugin.gson.adapters.GrailsDomainSerializer.eachUnvisitedProperty(GrailsDomainSerializer.groovy:51)
      5. grails.plugin.gson.adapters.GrailsDomainSerializer.serialize(GrailsDomainSerializer.groovy:27)
      5 frames
    5. Gson
      Gson$3.serialize
      1. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:70)
      2. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:63)
      3. com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
      4. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:96)
      5. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:60)
      6. com.google.gson.Gson.toJson(Gson.java:586)
      7. com.google.gson.Gson.toJsonTree(Gson.java:479)
      8. com.google.gson.Gson$3.serialize(Gson.java:140)
      8 frames
    6. grails.plugin.gson
      GrailsDomainSerializer.serialize
      1. grails.plugin.gson.adapters.GrailsDomainSerializer$_serialize_closure1.doCall(GrailsDomainSerializer.groovy:44)
      2. grails.plugin.gson.adapters.GrailsDomainSerializer$_eachUnvisitedProperty_closure2.doCall(GrailsDomainSerializer.groovy:56)
      3. grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty(GrailsDomainSerializer.groovy:70)
      4. grails.plugin.gson.adapters.GrailsDomainSerializer.eachUnvisitedProperty(GrailsDomainSerializer.groovy:51)
      5. grails.plugin.gson.adapters.GrailsDomainSerializer.serialize(GrailsDomainSerializer.groovy:27)
      5 frames
    7. Gson
      Gson$3.serialize
      1. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:70)
      2. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:63)
      3. com.google.gson.Gson.toJson(Gson.java:586)
      4. com.google.gson.Gson.toJsonTree(Gson.java:479)
      5. com.google.gson.Gson$3.serialize(Gson.java:140)
      5 frames
    8. grails.plugin.gson
      GrailsDomainSerializer.serialize
      1. grails.plugin.gson.adapters.GrailsDomainSerializer$_serialize_closure1.doCall(GrailsDomainSerializer.groovy:44)
      2. grails.plugin.gson.adapters.GrailsDomainSerializer$_eachUnvisitedProperty_closure2.doCall(GrailsDomainSerializer.groovy:56)
      3. grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty(GrailsDomainSerializer.groovy:70)
      4. grails.plugin.gson.adapters.GrailsDomainSerializer.eachUnvisitedProperty(GrailsDomainSerializer.groovy:51)
      5. grails.plugin.gson.adapters.GrailsDomainSerializer.serialize(GrailsDomainSerializer.groovy:27)
      5 frames
    9. Gson
      Gson$3.serialize
      1. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:70)
      2. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:63)
      3. com.google.gson.Gson.toJson(Gson.java:586)
      4. com.google.gson.Gson.toJsonTree(Gson.java:479)
      5. com.google.gson.Gson$3.serialize(Gson.java:140)
      5 frames
    10. grails.plugin.gson
      GrailsDomainSerializer.serialize
      1. grails.plugin.gson.adapters.GrailsDomainSerializer$_serialize_closure1.doCall(GrailsDomainSerializer.groovy:35)
      2. grails.plugin.gson.adapters.GrailsDomainSerializer$_eachUnvisitedProperty_closure2.doCall(GrailsDomainSerializer.groovy:59)
      3. grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty(GrailsDomainSerializer.groovy:70)
      4. grails.plugin.gson.adapters.GrailsDomainSerializer.eachUnvisitedProperty(GrailsDomainSerializer.groovy:51)
      5. grails.plugin.gson.adapters.GrailsDomainSerializer.serialize(GrailsDomainSerializer.groovy:27)
      5 frames
    11. Gson
      Gson$3.serialize
      1. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:70)
      2. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:63)
      3. com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
      4. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:96)
      5. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:60)
      6. com.google.gson.Gson.toJson(Gson.java:586)
      7. com.google.gson.Gson.toJsonTree(Gson.java:479)
      8. com.google.gson.Gson$3.serialize(Gson.java:140)
      8 frames
    12. grails.plugin.gson
      GrailsDomainSerializer.serialize
      1. grails.plugin.gson.adapters.GrailsDomainSerializer$_serialize_closure1.doCall(GrailsDomainSerializer.groovy:35)
      2. grails.plugin.gson.adapters.GrailsDomainSerializer$_eachUnvisitedProperty_closure2.doCall(GrailsDomainSerializer.groovy:56)
      3. grails.plugin.gson.adapters.GrailsDomainSerializer.eachProperty(GrailsDomainSerializer.groovy:70)
      4. grails.plugin.gson.adapters.GrailsDomainSerializer.eachUnvisitedProperty(GrailsDomainSerializer.groovy:51)
      5. grails.plugin.gson.adapters.GrailsDomainSerializer.serialize(GrailsDomainSerializer.groovy:27)
      5 frames
    13. Gson
      Gson.toJson
      1. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:70)
      2. com.google.gson.TreeTypeAdapter.write(TreeTypeAdapter.java:63)
      3. com.google.gson.Gson.toJson(Gson.java:586)
      4. com.google.gson.Gson.toJson(Gson.java:565)
      5. com.google.gson.Gson.toJson(Gson.java:540)
      5 frames
    14. grails.plugin.gson
      ArtefactEnhancer$_enhanceControllers_closure1.doCall
      1. grails.plugin.gson.converters.GSON.render(GSON.groovy:49)
      2. grails.plugin.gson.converters.GSON.render(GSON.groovy:58)
      3. grails.plugin.gson.api.ArtefactEnhancer$_enhanceControllers_closure1.doCall(ArtefactEnhancer.groovy:29)
      3 frames
    15. com.aire.pei
      TestingController.gsontest
      1. com.aire.pei.TestingController.gsontest(TestingController.groovy:166)
      1 frame
    16. grails.plugin.cache
      AbstractFilter.doFilter
      1. grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
      2. grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
      2 frames
    17. org.apache.shiro
      SavedRequestFilter.doFilter
      1. org.apache.shiro.grails.SavedRequestFilter.doFilter(SavedRequestFilter.java:55)
      1 frame
    18. Shiro
      OncePerRequestFilter.doFilter
      1. org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
      2. org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
      3. org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
      4. org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
      5. org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)
      6. org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
      7. org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
      7 frames
    19. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      3. java.lang.Thread.run(Thread.java:722)
      3 frames