users@glassfish.java.net

Re: Running embedded test with multimodule project

From: Major Péter <majorpetya_at_sch.bme.hu>
Date: Fri, 18 Jun 2010 23:06:52 +0200

> Kind-of. It's your entities classloading that Hibernate wants to
> participate in, but because there are no fancy classloader support in
> embedded mode, they fail. If you do not rely on lazy loading or any
> special detection of changes, your test will go through.
>
> For EclipseLink we disable weaving in embedded mode. Check if there is a
> setting in Hibernate to disable it to, and see if the error goes away.
> (If it does, let us know and we might be able to encode the setting).
>
> You can file another RFE (this one under entity-persistence), but it
> won't be as easy to implement as making changes to the doc...

https://glassfish.dev.java.net/issues/show_bug.cgi?id=12293
//it's not that easy to create an issue about something, which I don't
exactly understand :)

Anyways, I'm using LazyLoading, and planning to use it much more, so
then probably I'm going to add hibernate with test scope in my config
until this RFE is done.

> Check the classpath...

the noclassdeffounderror was for hibernateproxy and entity-enhancement,
the queries were throwing classnotfoundexception:
org.hibernate.hql.ast.HqlToken

Anyways by fixing my JNDI lookups with global naming, my tests looks
like are working now, so I'm probably will work on the tests finally
with this configuration.
My only problem is that the application name for 'global' lookups is
hard-coded, but I'll check ServletContext, maybe it has some info about
this...

Thanks for all the help, Marina

Regards,
Peter