Grails

Setting level "debug" on org.codehaus.groovy.grails.orm.hibernate causes NPE exception in GORM when using enums

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.3
  • Fix Version/s: 1.0.4
  • Component/s: Persistence
  • Labels:
    None
  • Environment:
    mac os x 10.5, java 1.5

Description

Peter L figured this out –

It appears that if you set the logging level to "debug" – and use an enum within your data model, you get an NPE exception / stack trace at :
...
Caused by: java.lang.NullPointerException
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.logCascadeMapping(GrailsDomainBinder.java:1713)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.setCascadeBehaviour(GrailsDomainBinder.java:1702)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindProperty(GrailsDomainBinder.java:1650)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.createProperty(GrailsDomainBinder.java:1464)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.createClassProperties(GrailsDomainBinder.java:1277)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindRootPersistentClassCommonValues(GrailsDomainBinder.java:1152)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindRoot(GrailsDomainBinder.java:927)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.bindClass(GrailsDomainBinder.java:839)

If you set it to "info" level or higher, no problems. Of course, when you DO get the stack trace, etc. it doesn't correctly generate the field in the DB or persist it, etc.

Appears that some "debug information" isn't there for logging if the field type winds up being an enum ..

Issue Links

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: