using hibernate annotations

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

using hibernate annotations

mattc
I'm hoping someone can help me get a Hibernate annotations prototype up and running.
Here's the error I'm getting when trying to launch the app:
org.hibernate.MappingException: An AnnotationConfiguration instance is required

I'm assuming this is happening because either my resource.xml is wrong or my applicationdatasource doen't have the correct properties.  I'm assuming the latter since
I've gone through the grails source for .02, the version I'm trying to use, and it appears that GrailsDomainAnnotationConfiguration.java has been deleted and no longer valid and I'm not sure what to use in its place.

Anyone have any thoughts?

Reply | Threaded
Open this post in threaded view
|

Re: running hibernate annotations

graemer
Matt,

Please see the section on hibernate integration in the user guide:
http://grails.org/Hibernate+Integration

It explains how to change the configuration class used so that
annotations can be used

Graeme

On 6/15/06, mattc <[hidden email]> wrote:

>
> I'm hoping someone can help me get a Hibernate annotations prototype up and
> running.
> Here's the error I'm getting when trying to launch the app:
> org.hibernate.MappingException: An AnnotationConfiguration instance is
> required
>
> I believe I'm getting this because grails' spring autowiring is setting the
> LocalSessionFactoryBean rather than its annotated version and I'm not able
> to ovverride this.
>
> I'm assuming this is happening because either my resource.xml is wrong or my
> applicationdatasource doen't have the correct properties.  I'm assuming the
> latter sinc
> I've gone through the site, and it appears that
> GrailsDomainAnnotationConfiguration.java has been deleted and no longer
> valid and I'm not sure what to use in its place
>
> Anyone have any thoughts?
>
>
> --
> View this message in context: http://www.nabble.com/running-hibernate-annotations-t1789317.html#a4874945
> Sent from the grails - user forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: running hibernate annotations

mattc
Thanks Graeme,

I did read through the documentation earlier but noticed when implementing that the .2 development release I'm using (grabbed from the install page) doesn't have the GrailsAnnotationConfiguration.class used in the documentation example...I browsed the src and junit tests and didn't find anything that jumped out as taking its place.  Would you suggest going back to .1 or another .2 development snapshot or am I just missing something obvious?  I would just skip it and move to hibernate mapping files or GORM as shown in the test suites etc, but I'm trying to prototype a Grails app against an existing domain of a few hundred ejb3 annotated entities...

Thanks again,
Matt


Reply | Threaded
Open this post in threaded view
|

Re: running hibernate annotations

graemer
Hi matt,

It may be because our build server (the one creating the snapshots) is
using jdk 1.4 (can you confirm this Dierk?) to build Grails, the class
in question is in the src/tiger directory of Grails where classes only
get compiled if jdk 1.5 is installed.

My only suggestion at this point is to get the code from CVS and build
it under jdk 1.5 until we can correct this.

Graeme

On 6/15/06, mattc <[hidden email]> wrote:

>
> Thanks Graeme,
>
> I did read through the documentation earlier but noticed when implementing
> that the .2 development release I'm using (grabbed from the install page)
> doesn't have the GrailsAnnotationConfiguration.class used in the
> documentation example...I browsed the src and junit tests and didn't find
> anything that jumped out as taking its place.  Would you suggest going back
> to .1 or another .2 development snapshot or am I just missing something
> obvious?  I would just skip it and move to hibernate mapping files or GORM
> as shown in the test suites etc, but I'm trying to prototype a Grails app
> against an existing domain of a few hundred ejb3 annotated entities...
>
> Thanks again,
> Matt
>
>
>
> --
> View this message in context: http://www.nabble.com/using-hibernate-annotations-t1789317.html#a4885011
> Sent from the grails - user forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

RE: running hibernate annotations

Dierk König
yes, the buildserver is on JDK 1.4 to make sure it compiles with this
version while most of us build locally with 1.5.
We had some regressions historically that prevented compiling with 1.4.
Therefore the setup.

Mittie

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]On Behalf
> Of Graeme Rocher
> Sent: Donnerstag, 15. Juni 2006 17:34
> To: [hidden email]
> Subject: Re: [grails-user] running hibernate annotations
>
>
> Hi matt,
>
> It may be because our build server (the one creating the snapshots) is
> using jdk 1.4 (can you confirm this Dierk?) to build Grails, the class
> in question is in the src/tiger directory of Grails where classes only
> get compiled if jdk 1.5 is installed.
>
> My only suggestion at this point is to get the code from CVS and build
> it under jdk 1.5 until we can correct this.
>
> Graeme
>
> On 6/15/06, mattc <[hidden email]> wrote:
> >
> > Thanks Graeme,
> >
> > I did read through the documentation earlier but noticed when
> implementing
> > that the .2 development release I'm using (grabbed from the
> install page)
> > doesn't have the GrailsAnnotationConfiguration.class used in the
> > documentation example...I browsed the src and junit tests and
> didn't find
> > anything that jumped out as taking its place.  Would you
> suggest going back
> > to .1 or another .2 development snapshot or am I just missing something
> > obvious?  I would just skip it and move to hibernate mapping
> files or GORM
> > as shown in the test suites etc, but I'm trying to prototype a
> Grails app
> > against an existing domain of a few hundred ejb3 annotated entities...
> >
> > Thanks again,
> > Matt
> >
> >
> >
> > --
> > View this message in context:
http://www.nabble.com/using-hibernate-annotations-t1789317.html#a4885011
> Sent from the grails - user forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: using hibernate annotations

mattc
In reply to this post by mattc
Thanks for your help.  I'm up and running now.