Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini JPA] predeploy Exception(if Entity X in bundle A extends Entity Y in bundle B on startup)
Gemini JPA] predeploy Exception [message #755481] Tue, 08 November 2011 15:59 Go to next message
Filipp A. is currently offline Filipp A.Friend
Messages: 49
Registered: February 2010
Member
Hi All,
On App startup, if Entity X in bundle A extends Entity Y in bundle B and bundle A depends on bundle B I get NullPointerException (s.below). It's happened only at startup. After all bundles are loaded, and I create my own EntityManager - everything is fine. If All Entities are in the same bundle is everything fine too.

Any ideas how to make it correctly ?


osgi> EclipseLinkProvider starting...
GeminiServicesUtil registering provider service for org.eclipse.persistence.jpa.PersistenceProvider
GeminiServicesUtil successfully registered provider service for org.eclipse.persistence.jpa.PersistenceProvider
GeminiExtender listening
GeminiExtender looking at existing bundles:
...

javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [puTest] failed.
Internal Exception: java.lang.NullPointerException
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1385)
	at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:98)
	at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:306)
	at org.eclipse.gemini.jpa.provider.GeminiOSGiInitializer.initializeFromBundle(GeminiOSGiInitializer.java:119)
	at org.eclipse.gemini.jpa.provider.EclipseLinkOSGiProvider.assignPersistenceUnitsInBundle(EclipseLinkOSGiProvider.java:191)
	at org.eclipse.gemini.jpa.PersistenceBundleExtender.tryAssigningPersistenceUnitsInBundle(PersistenceBundleExtender.java:172)
	at org.eclipse.gemini.jpa.PersistenceBundleExtender.bundleChanged(PersistenceBundleExtender.java:314)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1569)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1505)
	at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1500)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:487)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:253)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:173)
	at java.lang.Thread.run(Thread.java:680)
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [puTest] failed.
Internal Exception: java.lang.NullPointerException
	at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:221)
	... 17 more
Caused by: java.lang.NullPointerException
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:241)
	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:514)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1590)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:517)
	at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1320)
	... 16 more


for example:
bundle A:
@Entity
public class X extends Y{
	private String name;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}


bundle B:
@MappedSuperclass
public class Y {
	@Id
	protected long id;
	
	@Override
	public long getId() {
		return id;
	}

	@Override
	public void setId(long id) {
		this.id = id;
	}
}
Re: Gemini JPA] predeploy Exception [message #755495 is a reply to message #755481] Tue, 08 November 2011 16:35 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
The OSGi JPA spec that Gemini JPA has implemented does not support persistence units spanning multiple bundles. We are considering this as a value-add for a future Gemini JPA release, though. I just entered bug 363195 to track this.

-Mike
Re: Gemini JPA] predeploy Exception [message #755565 is a reply to message #755495] Tue, 08 November 2011 19:53 Go to previous message
Filipp A. is currently offline Filipp A.Friend
Messages: 49
Registered: February 2010
Member
thank you very much for explanation!
Previous Topic:[Gemini JPA] Migration from EL OSGI to Gemini JPA
Next Topic:Migrating from spring-dm to blueprint
Goto Forum:
  


Current Time: Thu Oct 18 23:20:21 GMT 2018

Powered by FUDForum. Page generated in 0.02234 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top