Thursday 18 February 2010

Javassist Enhancement failed

Just spent the last few hours debugging this.

def adoptChild = {
Parent p = Parent.get(params.id)
p.child = Child.findByName(params.name)
assert p.save(flush:true)
redirect(action: 'showParentWithChild', id: p.id)
}

def showParentWithChild() {
Parent p = Parent.get(params.id) // Javassist Enhancement failed stack trace here
render("OK")
}

Turned out that the child class had a private constructor (no idea why). I ditched the constructor and everything was back to normal.