Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini predeployment seems to not find Entity classes
Gemini predeployment seems to not find Entity classes [message #675105] Mon, 30 May 2011 10:16 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi,

I have the following configuration in a SE environment:

Bundle A: contains entity classes without any annotations provided by eclipselink
Bundle B: An own jpa bundle that provides a service that is used in several of my other (UI) bundles, which depends on Bundle A. This bundle provides the persistence.xml and the orm.xml, which contains the jpa metadata for the entity classes. I use fieldaccess.

EclipseLink 2.0.0 bundles installed
Gemini JPA 1.0.0 RC1 bundles installed
osgi.enterprise bundle installed

I choosed the solution with bundle A and B, to separate my model from the jpa implementation.

Now my problem: Starting my application there are exceptions thrown, saying, the field xy does not exist in the entity class:

!ENTRY org.eclipse.osgi 4 0 2011-05-30 12:11:57.975
!MESSAGE An unexpected runtime error has occurred.
!STACK 0
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [herakles] failed.
Internal Exception: Exception [EclipseLink-7215] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Could not load the field named [id] on the class [class ch.eugster.herakles.persistence.model.DescriptorElement]. Ensure there is a corresponding field with that name defined on the class.
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1127)
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:101)
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:309)
at org.eclipse.gemini.jpa.provider.GeminiOSGiInitializer.registerBundle(GeminiOSGiInitializer.java:101)
at org.eclipse.gemini.jpa.provider.EclipseLinkOSGiProvider.assignPersistenceUnitsInBundle(EclipseLinkOSGiProvider.java:207)
at org.eclipse.gemini.jpa.PersistenceBundleExtender.tryAssigningPersistenceUnitsInBundle(PersistenceBundleExtender.java:187)
at org.eclipse.gemini.jpa.PersistenceBundleExtender.bundleChanged(PersistenceBundleExtender.java:298)
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:1522)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1458)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1453)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:485)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:251)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:173)
at java.lang.Thread.run(Thread.java:662)
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [herakles] failed.
Internal Exception: Exception [EclipseLink-7215] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Could not load the field named [id] on the class [class ch.eugster.herakles.persistence.model.DescriptorElement]. Ensure there is a corresponding field with that name defined on the class.
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:210)
... 17 more
Caused by: Exception [EclipseLink-7215] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Could not load the field named [id] on the class [class ch.eugster.herakles.persistence.model.DescriptorElement]. Ensure there is a corresponding field with that name defined on the class.
at org.eclipse.persistence.exceptions.ValidationException.invalidFieldForClass(ValidationException.java:2562)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.getAccessibleField(ClassAccessor.java:618)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessors(ClassAccessor.java:311)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.preProcess(ClassAccessor.java:1093)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.preProcess(MappedSuperclassAccessor.java:627)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.preProcess(EntityAccessor.java:525)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1504)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:484)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:454)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1081)
... 16 more

Re: Gemini predeployment seems to not find Entity classes [message #675183 is a reply to message #675105] Mon, 30 May 2011 14:12 Go to previous message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Hi Christian,

Unfortunately the OSGi JPA specification prohibits this kind of configuration. It explicitly requires that all entity classes and resources must be in the persistence bundle (the bundle that contains the Meta-Persistence header in it).

One option that you may want to consider is to embed bundle A inside of bundle B. You would need to ensure that the bundle-classpath of bundle B is modified to include the nested Bundle A. This nesting is permitted, although not as neat as what you were trying to do originally. It also doesn't make reuse of bundle A by other bundles very easy.

-Mike

P.S. Also, Gemini JPA RC1 requires EclipseLink 2.2 (not 2.0) so please ensure you have downloaded those bundles and are using them.
Previous Topic:Gemini Web 2.0.0 Milestone 1
Next Topic:Blueprints release date?
Goto Forum:
  


Current Time: Tue Mar 19 08:40:02 GMT 2024

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

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

Back to the top