Leopard SWT JPA Problem [message #242772] |
Tue, 11 December 2007 04:40 |
Eclipse User |
|
|
|
Originally posted by: reg.hill-labs.co.nz
Hi,
I have a couple of SWT apps that use JPA 3 for persistence and they all
worked fine under Windows and OS X Tiger... then... I upgraded to Leopard
(yes, that seems to have been a big mistake!).
Now quite a few of my apps don't run.
I have made a sample app that runs in the console, initializes my JPA
stuff just fine... but as soon as I add the Mac SWT library it then fails
when I am creating the entity manager factory as follows:
private EntityManagerFactory emf =
persistence.createEntityManagerFactory("TestJPA");
private EntityManager em = emf.createEntityManager();
Fails with the following exception:
java.lang.NullPointerException
at javax.persistence.Persistence.findAllProviders(Persistence.j ava:65)
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:48)
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:33)
at Store.<init>(Store.java:14)
at Store.getInstance(Store.java:22)
at Main.main(Main.java:18)
Remove the SWT library and it works again.
I still had the Java 6SE pre-release laying around so tried it with that,
it worked but complained about not having the carbon swt libraries, and
they seemed to be where they should be, so I gave up on that (ps. I am a
bit of a newbie...)
Has anyone had JPA stuff working in an SWT application? If so, how do you
do it?
Regards
Colin
|
|
|
Powered by
FUDForum. Page generated in 0.09481 seconds