Grails

Domain classes with that have properties of the same class cause grails hibernate to crash on startup

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.0.2
  • Fix Version/s: 1.0.3
  • Component/s: Persistence
  • Labels:
    None
  • Environment:
    XP Dev Machine

Description

Domain classes such as this one:

class Person {
Person creator
}

cause grails hibernate to crash with an NPE error.

error at end of stack trace:

2008-03-20 16:22:52.460::WARN: Nested in org.springframework.beans.factory.Bean
CreationException: Error creating bean with name 'transactionManager': Cannot re
solve reference to bean 'sessionFactory' while setting bean property 'sessionFac
tory'; nested exception is org.springframework.beans.factory.BeanCreationExcepti
on: Error creating bean with name 'sessionFactory': Invocation of init method fa
iled; nested exception is java.lang.NullPointerException:
java.lang.NullPointerException
at java.security.AccessController.doPrivileged(Native Method)
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)

Issue Links

Activity

Hide
Chanwit Kaewkasi added a comment -

I've got a patch. All tests passed. But I think we need a new test for circular referencing regression.

Show
Chanwit Kaewkasi added a comment - I've got a patch. All tests passed. But I think we need a new test for circular referencing regression.
Hide
Chanwit Kaewkasi added a comment -

It seems that the test "CircularRelationshipTests" could not catch this bug.

Show
Chanwit Kaewkasi added a comment - It seems that the test "CircularRelationshipTests" could not catch this bug.
Hide
Peter Ledbrook added a comment -

I'm not sure the patch is correct. Surely isBidirectional() should not be returning true in this case? I'm sure it's a uni-directional relationship. I'll have a look at why Grails considers the relationship to be bidirectional.

Show
Peter Ledbrook added a comment - I'm not sure the patch is correct. Surely isBidirectional() should not be returning true in this case? I'm sure it's a uni-directional relationship. I'll have a look at why Grails considers the relationship to be bidirectional.
Hide
Peder Jakobsen added a comment -

Hi, I'm new to grails and patching, but I need this patch in order to get the example Grails code from Groovy in Action to run.

I'n order to apply this patch, do I need to have the source code checked out from subversion? WHere can I read more about patching from Jira? My search came up empty. Also, how can I check out from the grails repos?

Thanks

Show
Peder Jakobsen added a comment - Hi, I'm new to grails and patching, but I need this patch in order to get the example Grails code from Groovy in Action to run. I'n order to apply this patch, do I need to have the source code checked out from subversion? WHere can I read more about patching from Jira? My search came up empty. Also, how can I check out from the grails repos? Thanks
Hide
Peter Ledbrook added a comment -

You have two options:

  1. Get a 1.0.3-SNAPSHOT from the build server, or check out the latest code from subversion
  2. Download the 1.0.2 source code from the Grails website and apply the patch (for example: patch -p0 < grails_2689.patch )

Information on checking the source code out of subversion can be found here.

Show
Peter Ledbrook added a comment - You have two options:
  1. Get a 1.0.3-SNAPSHOT from the build server, or check out the latest code from subversion
  2. Download the 1.0.2 source code from the Grails website and apply the patch (for example: patch -p0 < grails_2689.patch )
Information on checking the source code out of subversion can be found here.
Hide
Peder Jakobsen added a comment -

The snapshots page is empty at http://snapshots.dist.codehaus.org/grails/

Show
Peder Jakobsen added a comment - The snapshots page is empty at http://snapshots.dist.codehaus.org/grails/
Hide
Pam added a comment -

Any idea when 1.0.3 is coming out? I'm not too comfortable using code I've patched and build myself.

Show
Pam added a comment - Any idea when 1.0.3 is coming out? I'm not too comfortable using code I've patched and build myself.
Hide
Peter Ledbrook added a comment -

No, sorry. The main developers are really tied up at the moment, unfortunately. I would seriously consider getting hold of one of the 1.0.3 snapshots. Just follow the instructions here:

http://www.grails.org/Download

under "Grails 1.1 Development Build".

Show
Peter Ledbrook added a comment - No, sorry. The main developers are really tied up at the moment, unfortunately. I would seriously consider getting hold of one of the 1.0.3 snapshots. Just follow the instructions here: http://www.grails.org/Download under "Grails 1.1 Development Build".
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (8)
Watch (14)

Dates

  • Created:
    Updated:
    Resolved: