History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-2933
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Blocker Blocker
Assignee: Jeff Brown
Reporter: Sylvain Gibier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Grails

Self-referencing domain class throws nullpointer exception

Created: Sunday 02:14 PM   Updated: Sunday 07:31 PM
Component/s: Persistence
Affects Version/s: 1.0.2
Fix Version/s: 1.0.3

Time Tracking:
Not Specified

Environment: Linux + mysql 5.0.38
Issue Links:
Duplicate
 


 Description  « Hide
Hi,

Simple class CmsPage with a self-reference to a parent.

class CmsPage {
String name
CmsPage parent

static belongsTo = [parent:CmsPage]
// Validations
static constraints = { parent(nullable:true) }

}

When boostrapping the app in development mode - throwing a spring instanciation exception as below...

[4124] context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
at java.security.AccessController.doPrivileged(Native Method)
at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy:68)
at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy)
at Init_groovy$_run_closure6.doCall(Init_groovy:128)
at RunApp_groovy$_run_closure2.doCall(RunApp_groovy:67)
at RunApp_groovy$_run_closure2.doCall(RunApp_groovy)
at RunApp_groovy$_run_closure1.doCall(RunApp_groovy:59)
at RunApp_groovy$_run_closure1.doCall(RunApp_groovy)
at gant.Gant.dispatch(Gant.groovy:271)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:436)
at gant.Gant.processArgs(Gant.groovy:372)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
at java.security.AccessController.doPrivileged(Native Method)
... 13 more



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Brown - 11/May/08 07:30 PM