|
|
Abstract classes with Grails
Hello,
(I asked this question on the STS foum, didn't notic that there is a specific one for GRAILS)
Is it possible to work with abstract classes in Grails, like in Java!? It seems to me that it's possible with Groovy, but with Grails I have a compilation problem when I declare a class as quot;abstractquot;...I am using the STS IDE for the development, when I save a class as quot;abstractquot;, I have this message, before the server shuts down:Code:
2011-02-06 18:24:48,793 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org..beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org..beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
org..beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org..beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org..beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
I understand that we cannot generate a view for an abstract class... but then how to deal with abstract classes in Grails?
I have a class A, and I want to say that it has as attributes a set of objects belonging to the abstract class B:Code:
abstract class B {
static constraints = { }
}
class A {
static constraints = { }
static hasMany = [b:B]
}
Is it possible with Grails!? I guess the answer is yes... well I hope... but how!?
Thanks a lot.
Abstract domain class support is due to be improved for Grails 1.4.
Unfortunately, that stack trace isn't sufficient to determine what specific problem you're having. See if there is any more information in the target/stacktrace.log file. |
|