Issue Details (XML | Word | Printable)

Key: GRAILS-2689
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Graeme Rocher
Reporter: Matt Lentzner
Votes: 8
Watchers: 14
Operations

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

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

Created: 21/Mar/08 02:03 PM   Updated: 11/May/08 07:31 PM
Component/s: Persistence
Affects Version/s: 1.0.2
Fix Version/s: 1.0.3

Time Tracking:
Not Specified

File Attachments: 1. Text File grails_2689.patch (0.9 kB)

Environment: XP Dev Machine
Issue Links:
Duplicate
 


 Description  « Hide
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)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Chanwit Kaewkasi added a comment - 22/Mar/08 04:26 PM
I've got a patch. All tests passed. But I think we need a new test for circular referencing regression.

Chanwit Kaewkasi added a comment - 22/Mar/08 05:17 PM
It seems that the test "CircularRelationshipTests" could not catch this bug.

Peter Ledbrook added a comment - 31/Mar/08 04:35 AM
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.

Peder Jakobsen added a comment - 21/Apr/08 01:40 AM
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


Peter Ledbrook added a comment - 21/Apr/08 02:57 AM
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.


Peder Jakobsen added a comment - 21/Apr/08 04:43 AM
The snapshots page is empty at http://snapshots.dist.codehaus.org/grails/

Pam added a comment - 30/Apr/08 10:22 AM
Any idea when 1.0.3 is coming out? I'm not too comfortable using code I've patched and build myself.

Peter Ledbrook added a comment - 30/Apr/08 10:40 AM
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".