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

Key: GRAILS-2032
Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Ricardo J. Méndez
Votes: 0
Watchers: 0
Operations

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

Association refers to an unmapped class

Created: 12/Dec/07 04:19 PM   Updated: 03/Jul/08 05:24 PM
Component/s: Persistence
Affects Version/s: 1.0-RC3
Fix Version/s: 1.0.4

Time Tracking:
Not Specified

File Attachments: 1. Text File Stacktrace.txt (904 kb)



 Description  « Hide
More and more often I've been getting exceptions from Grails RC2 and RC3 regarding an 'unmapped class'. Doing a grails clean solves the problem, but it would seem something's wrong for it to appear so often.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table customer_note refers to an unmapped class: Customer

I'll add the full stack trace ad an attachment.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Ricardo J. Méndez - 12/Dec/07 04:21 PM
Full exception stack trace.

Graeme Rocher - 24/Mar/08 05:28 PM
please attach a sample with steps to reproduce

Ricardo J. Méndez - 24/Mar/08 10:07 PM
Haven't gotten this issue in 1.0.1 at all.

Pam - 29/Apr/08 12:01 PM
Hi, I'm still got this issue and grails clean doesn't fix it. I had to go in manually and delete a bunch of *.class files in the project directory. I think they were something that Eclipse created when I imported the project. I had checked "Disable Groovy compiler generating class files" but sometimes it still does it when I import a project.

Deleting the .class files, and then doing grails clean fixed this for me.


Matthias - 12/May/08 08:38 AM
I just had this same issue with grails-1.0.3-SNAPSHOT.

grails-clean alone did not help; I then did a Project --> clean in Eclipse followed by a grails clean. That did the job. Don't think it's a grails bug; much more one of the myriads of issues related to developing a Grails app using Eclipse... the Eclipse support is really extremely poor.


Alberto Brandolini - 03/Jul/08 05:24 PM
Same situation, deleting .class files from within Eclipse solved the problem.

I made 2 mistakes before that are maybe related to the root cause:
1) a typo while creating a controller so I had 2 controller classes for the same class, which was the one pointing to the apparently unmapped class
2) i declared in class A an attribute of type B without the 'static belongsTo = A', then I added it, but was too late.

I think it's related to 2) I'll try to isolate the conditions.