users@glassfish.java.net

Re: Running embedded test with multimodule project

From: Mitesh Meswani <mitesh.meswani_at_oracle.com>
Date: Fri, 18 Jun 2010 15:18:17 -0700

On 6/18/2010 2:06 PM, Major Péter wrote:
>> 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.
>
If adding hibernate to your pom's test scope solved your issue, did you
try adding the hibernate jar containing missing classes
(org/hibernate/proxy/HibernateProxy) to GlassFish lib dir ?

Thanks,
Mitesh

>
>> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>