Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini JPA: Can not get Weaving Hook working
Gemini JPA: Can not get Weaving Hook working [message #729262] Sun, 25 September 2011 16:37 Go to next message
Nils Hartmann is currently offline Nils HartmannFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

I'm using Gemini JPA 1.0.0RC3 with Equinox 3.7.0 and EclipseLink 2.3.0 but cannot get Weaving to work. I always get this message on the console when starting the bundle containing my persistence unit:

No BundleContext property, not registering Weaving Hook

Any idea what could be wrong? Everything else with EclipseLink seems to work fine.

Thanks,
Nils
Re: Gemini JPA: Can not get Weaving Hook working [message #729653 is a reply to message #729262] Mon, 26 September 2011 17:41 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Hi Nils,

Is there anything that you can tell us about your application or execution environment that may help us figure out what might be causing it? I assume you have the weaving debugging flag on, are there any other unexpected debug statements?

Thanks,
-Mike
Re: Gemini JPA: Can not get Weaving Hook working [message #729678 is a reply to message #729653] Mon, 26 September 2011 18:35 Go to previous messageGo to next message
Nils Hartmann is currently offline Nils HartmannFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

I realized that there is a NullPointerException thrown before - see below. I've debugged a little bit and found out that the EntityAccessor class tries to get the superclass of my own entity superclass (line 286, parentClass=parentClass.getSuperclass()). Since this call returns null, the NPE in line 241 of EntityAccessor is thrown. The class it's inspecting in this moment is an abstract superclass annotated with "@MappedSuperclass" that inherited only from java.lang.Object.

And as written in my previous post everything seems to work, even with this exception - only the weaving does not work.

Regards,
Nils

This is the stacktrace:
!ENTRY org.eclipse.osgi 4 0 2011-09-26 20:25:48.165
!MESSAGE An unexpected runtime error has occurred.
!STACK 0
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [nh.btip.PersistenceUnit] 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: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:680)
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [nh.btip.PersistenceUnit] 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
Re: Gemini JPA: Can not get Weaving Hook working [message #730048 is a reply to message #729678] Tue, 27 September 2011 14:36 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
It looks like the exception could be erroring out the predeploy process, causing the transformer to not be set and you are just getting lucky that it likely happened at the end of the processing so that other entities classes were not left unprocessed by EclipseLink. I would recommend entering a bug against EclipseLink for this error, and a bug against Gemini JPA for not trying harder to find out what the problem really was.
Re: Gemini JPA: Can not get Weaving Hook working [message #730116 is a reply to message #730048] Tue, 27 September 2011 16:31 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
BTW, there is apparently a bug already entered in EclipseLink for this problem. See bug 350516 and go vote for it to be fixed Smile
Re: Gemini JPA: Can not get Weaving Hook working [message #730167 is a reply to message #730116] Tue, 27 September 2011 18:36 Go to previous messageGo to next message
Guy Pelletier is currently offline Guy PelletierFriend
Messages: 19
Registered: July 2009
Junior Member
Hi Nils,

Any chance you could try against the latest 2.3.1 nightly?

http://www.eclipse.org/eclipselink/downloads/nightly.php

I'm not able to reproduce this exception and wondering if it has been dealt with through another bug fix.

Cheers,
Guy

Re: Gemini JPA: Can not get Weaving Hook working [message #730806 is a reply to message #730167] Thu, 29 September 2011 08:12 Go to previous messageGo to next message
Nils Hartmann is currently offline Nils HartmannFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

thanks all for your answers.

I've tried the 2.3.1 nightly but the same NullPointerException is thrown. I'll try to build a reproduceable test case.

Nils
Re: Gemini JPA: Can not get Weaving Hook working [message #731017 is a reply to message #730806] Thu, 29 September 2011 17:34 Go to previous message
Nils Hartmann is currently offline Nils HartmannFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

I wasn't able to reproduce the problem in a small test case, but I found the reason anyway. My 'MappedSuperclass' was in a different Bundle than the Entity classes and the persistence.xml. According to OSGi JPA spec this is not allowed I guess, as all Entities have to be in one Bundle. So it's my fault. The weaving now also works.

Strange that in my simple test case it also worked with the MappedSuperclass in a different bundle while in my "real" project the NPE comes up. And in both cases EclipseLink seems to work well regardless of the Exception.

Thanks,
Nils

Previous Topic:Gemini Simple ManagedService
Next Topic:Gemini DBAccess 1.0.0 Released!
Goto Forum:
  


Current Time: Tue Mar 19 11:42:26 GMT 2024

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

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

Back to the top