Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » EntityManagerFactory (Eclipselink RCP) return NullPointerException
icon12.gif  EntityManagerFactory (Eclipselink RCP) return NullPointerException [message #962113] Sun, 28 October 2012 18:04 Go to next 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 put the plug-in 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 application, emf is not referring to null (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.
Re: EntityManagerFactory (Eclipselink RCP) return NullPointerException [message #962510 is a reply to message #962113] Mon, 29 October 2012 01:31 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26000
Registered: July 2009
Senior Member
Better to ask on the EclipseLink forum:
http://www.eclipse.org/forums/eclipse.rt.eclipselink

On 29/10/2012 2:18 AM, Azi Azwady Jamaludin wrote:
> 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
> put the plug-in 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 application, emf
> is not referring to null (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.
Previous Topic:Where to go to contribute to Eclipse?
Next Topic:Eclipse Juno (4.2.1) and RedHat 5.8 64bit
Goto Forum:
  


Current Time: Sat Aug 23 05:34:14 EDT 2014

Powered by FUDForum. Page generated in 0.01975 seconds