Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EntityManagerFactory (Eclipselink RCP) return NullPointerException
icon7.gif  EntityManagerFactory (Eclipselink RCP) return NullPointerException [message #963450] Mon, 29 October 2012 16:46 Go to previous message
Azi Azwady Jamaludin is currently offline Azi Azwady Jamaludin
Messages: 10
Registered: October 2012
Junior Member
Greetings,

I'm developing RCP application integrating Eclipselink JPA. The RCP project named as mamsys-dispose.

I've also creates a separate project for JPA and I've generates the entities using EclipseLink and convert it to Plug-in project. I also put my EntityManagerFactory and models in this project (JPA). I then add it as required plug-in at mamsys-dispose (MANIFEST-MF > Dependencies)

I'm referring to the 'comics' example and note that the example is old and I've made a number of configuration such as using Activator (org.eclipse.persistence.jpa.osgi) as the classloader. The emf (instance) in comics example refers to null but in my development, emf is not referring to null. I put as EntityManagerFactory emf;. Only at createEntityManager, I put:-
if (emf == null)
init();

But I'm still got these stack trace:-

java.version=1.6.0_35
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -application org.eclipse.mamsys-dispose.application
Command-line arguments: -application org.eclipse.mamsys-dispose.application -data /Users/azwady/eclipseRCPproj/../runtime-org.eclipse.mamsys-dispose.application -dev file:/Users/azwady/eclipseRCPproj/.metadata/.plugins/org.eclipse.pde.core/org.eclipse.mamsys-dispose.application/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog

!ENTRY org.eclipse.core.jobs 4 2 2012-10-29 04:59:32.852
!MESSAGE An internal error occurred during: "Init View...".
!STACK 0
java.lang.NullPointerException
at org.eclipse.mamsysdispose.model.connection.MamsysEntityManagerFactory.createEntityManager(MamsysEntityManagerFactory.java:54)
at org.eclipse.mamsysdispose.model.CreateCaseModel.<init>(CreateCaseModel.java:24)
at org.eclipse.mamsysdispose.views.viewparts.NewCaseView$2$1.run(NewCaseView.java:162)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What is missing here?.
**BTW, I'm creating this application on my Macbook and using Eclipse RCP Juno SR1.
 
Read Message icon7.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon7.gif
Read Message
Read Message
Previous Topic:MOXy and JAXB Marshaller.Listener getting XMLRoot object
Next Topic:EclipseLink zipped p2 repositories?
Goto Forum:
  


Current Time: Sat May 25 23:03:09 EDT 2013

Powered by FUDForum. Page generated in 0.02770 seconds