-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NullPointerException in Eclipse 3.3.1.1 when creating EMF
PostPosted: Sat Dec 01, 2007 9:45 pm 
Newbie

Joined: Tue Apr 17, 2007 8:05 pm
Posts: 5
Hi,

Just a newbie trying to get my application that used to work, working on my Mac which now has Eclipse 3.3.1.1 installed.

I haven't changed any code or persistence files since running Eclipse 3.3, and am not sure what else has changed other than an upgrade to 3.3.1.1 (have now removed 3.3 so can't immediately go back and test this, but will want to move to 3.3.1.1 anyway.

I am now getting the following error when running this line:
emf = Persistence.createEntityManagerFactory("MyPU", new Properties());
Error
java.lang.NullPointerException
at javax.persistence.Persistence.findAllProviders(Persistence.java:98)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at LabSysStore.<init>(LabSysStore.java:34)
at LabSysStore.getInstance(LabSysStore.java:27)
at MainWindow.startTest(MainWindow.java:141)
at MainWindow$1.widgetSelected(MainWindow.java:92)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1495)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1519)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1504)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1295)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3350)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2954)
at MainWindow.open(MainWindow.java:57)
at MainWindow.main(MainWindow.java:41)
-------------
Running hibernate 3.2.5
Entity Manager 3.3.1.GA
Annotations 3.3.0.GA

Any pointers appreciated.
Regards
Colin


Top
 Profile  
 
 Post subject: NullPointerException in Leopard when creating EMF
PostPosted: Mon Dec 03, 2007 6:16 pm 
Newbie

Joined: Tue Apr 17, 2007 8:05 pm
Posts: 5
Ok,

After much mucking around, I found the solution to my problem...

It seems OS X Leopard has broken JPA when used with SWT in my application...

I found that as soon as I added the SWT Jar to my test application I got the previous mentioned error when creating the Entitiy Manager Factory (I have no idea why, and am a bit of a newbie, so don't think I will ever find out why).

After installing old versions of Eclipse (not the problem), I found the Java 6 SE beta that Apple had temporarily available laying around on my external HD (Yay! I would really love to know what Apple is planning with Java... should I stay or should I go now??... but that is another story), installed the beta Java 6, and hey presto, I could now add in my SWT jar and my application works... swap the runtime in eclipse back to version 5 that comes with Leopard, and it breaks again.

Back to the later version of Eclipse, and yip, that works too with the beta Java 6 SE... so... now just have to wait and see when Apple releases version 6 properly so I can continue (or use Windows or Linux...).

Regards
Colin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.