persistence@glassfish.java.net

Re: Problem between MacOSX and Windows (followup)

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Wed, 08 Nov 2006 13:05:02 -0800

Hi Manfred,

If you still need the answers...

There is an nbproject in the persistence-api directory, but I had
never tested it. But I tried to use 'ant' directly there and it
seems to work.

Now there can be one trick - javax.persistence classes are packaged
into 2 jars - javaee.jar (which is updated by the build, so it
might fail in your setup if you don't have GF installed in the expected
location), and toplink-essentials.jar (which is created by the build
of the entity-persistence module). So you might need to add the
build/classes directory in front of your classpath.

HTH,
-marina

Manfred Riem wrote On 11/08/06 11:30,:
> Hi Marina,
>
> Is there an easy way to get the persistence project? Eg. as a NetBeans
> project?
>
> Kind regards,
> Manfred Riem
> mriem_at_manorrock.org
> http://www.manorrock.org/
> Founding Java Champion
>
> -----Original Message-----
> From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
> Sent: Wednesday, November 08, 2006 11:20 AM
> To: persistence_at_glassfish.dev.java.net
> Subject: Re: Problem between MacOSX and Windows (followup)
>
> 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/j
>>avax/persistence/Persistence.java?r=1.6#l48)
>>
>>Kind regards,
>>Manfred Riem
>>mriem_at_manorrock.org
>>http://www.manorrock.org/
>>Founding Java Champion