persistence@glassfish.java.net

Re: Problem between MacOSX and Windows (followup)

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Wed, 08 Nov 2006 10:20:23 -0800

Hi Manfred,

It can as well be a class loader issue. Can it be that a no-op constructor
called via 'loader.loadClass(s).newInstance()' throws an exception (for whatever
reason) on MacOSX? Can you try?

You can also change the Persistence code and call findAllProviders() in the
static{} block instead to see if this is indeed a threading issue.

thanks,
-marina

Manfred Riem wrote:
> Hi there,
>
> I have done some more digging and it appears that the current implementation
> has a problem on MacOSX. I implemented my own Persistence Provider and if
> I do the following in its constructor it successfully finds it.
>
> public MyPersistenceProvider() {
> System.out.println("Whatever");
> }
>
> If I comment out the System.out.println statement it cannot find this Persistence
> Provider. Looking at the code of the Persistence class I think it has to do with
> a threading issue. Can someone confirm this?
>
> Note my JUnit tests call Persistence.createEntityManagerFactory(String persistenceUnitName, Map properties)
>
> (see http://fisheye5.cenqua.com/browse/glassfish/persistence-api/src/java/javax/persistence/Persistence.java?r=1.6#l48)
>
> Kind regards,
> Manfred Riem
> mriem_at_manorrock.org
> http://www.manorrock.org/
> Founding Java Champion