Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » EclipseLink weaving fragment require-bundle version
EclipseLink weaving fragment require-bundle version [message #783470] Wed, 25 January 2012 14:20 Go to next message
Eclipse UserFriend
Hi,

I'm trying to make eclipselink working in an osgi environment (not eclipse pde environment, but just standalone equinox).

But when I look at the org.eclipse.persistence.jpa.equinox.weaving bundle, I see that the fragment-Host is defined as:
Fragment-Host: org.eclipse.osgi;extension:=framework;bundle-version="3.4.0"

I'm running this combo on eclipse 3.7.1.XXXXX, resulting that the fragment can't start.

How can I find a workaround (I prefer not to override manifest, neither overriding all the manifest that imports org.eclipse.osgi)?

Regards,

Charlie
Re: EclipseLink weaving fragment require-bundle version [message #783483 is a reply to message #783470] Wed, 25 January 2012 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi Charlie,

Take a look at the http://wiki.eclipse.org/EclipseLink/Examples/OSGi/Equinox_Byte_Code_Weaving and the main http://wiki.eclipse.org/EclipseLink/Examples/OSGi which provides some general OSGi config info. They should cover what you're looking for.

Shaun
Re: EclipseLink weaving fragment require-bundle version [message #783710 is a reply to message #783483] Thu, 26 January 2012 04:26 Go to previous messageGo to next message
Eclipse UserFriend
After reading the doc (one time again), I have some questions:

My persistence.xml, my model classes and my EntityManager are defined in 3 different bundles (persistence.xml is a fragment of the entitymanager module).

Wich module must have the "Require-Bundle: org.eclipse.persistence.jpa;bundle-version="1.1.2"" Manifest entry?

Does the eclipselink start order must absolutely be
javax.persistence@4:start, \
 org.eclipse.persistence.jpa@5:start, \
 org.eclipse.persistence.jpa.osgi, \
 org.eclipse.persistence.antlr, \
 org.eclipse.persistence.asm, \
 org.eclipse.persistence.core, \
 org.eclipse.persistence.jpa.equinox, \
 hello.jpa@start, \

What if my hello bundle starts before the jpa.equinox one (or asm before antlr...), I have no control on my bundle start order but start level (running with Maven/Pax)?

Is the org.eclipse.update.configurator mandatory?

I did all of this without configurator, but my weaving fragment is not resolved (I'll try tonight with it).
My project also contains dependencies with equinox aspects, equinox hook and spring-weaving adaptor, can it be the source of the problem?

May I add the weaving fragment to the boot classpath (http://team.ops4j.org/wiki/display/paxrunner/Manage+boot+classpath#Managebootclasspath-bcp), bootdelegation or osgi-extra-package (there is an issue with pax and framework extension wich force this: https://github.com/nilshartmann/aries-spy-fly/blob/master/spi-fly-itests-old/src/test/java/org/apache/aries/spifly/CustomizerWithAopTest.java)?

Best regards, Charlie

Re: EclipseLink weaving fragment require-bundle version [message #783820 is a reply to message #783710] Thu, 26 January 2012 09:29 Go to previous messageGo to next message
Eclipse UserFriend
Hi Charlie,

The bundle that has to require o.e.p.jpa is the one containing the entities that are going to be weaved.

Bundle start order is critical to ensure weaving occurs before the classes are loaded. I can't help you with PAX but if it has a problem with framework extensions then I guess you have to do what you have to do.

Given your requirements I think you should move to Gemini JPA. Gemini JPA provides OSGi Enterprise specification compliant JPA based on EclipseLink. With Gemini you don't have to worry about requiring o.e.p.jpa nor do you have to worry about bundle order. Here's the Gemini Forum. The "native" EclipseLink JPA weaving support predates the standard and is deprecated in favour of the OSGi standard approach. So best to start there rather than investing further effort with the deprecated support.

One caution I do have is the use of Spring weaving. Gemini implements the OSGi enterprise spec and uses the OSGi weaving service. Spring likes to do things its own way and I have spoken with one person who had some issues. I'd either embrace an OSGi standards compliant application architecture or Spring's approach--but mixing the two can be painful.

Shaun
Re: EclipseLink weaving fragment require-bundle version [message #783823 is a reply to message #783710] Thu, 26 January 2012 09:29 Go to previous messageGo to next message
Eclipse UserFriend
Hi Charlie,

The bundle that has to require o.e.p.jpa is the one containing the entities that are going to be weaved.

Bundle start order is critical to ensure weaving occurs before the classes are loaded. I can't help you with PAX but if it has a problem with framework extensions then I guess you have to do what you have to do.

Given your requirements I think you should move to http://www.eclipse.org/gemini/jpa/. Gemini JPA provides OSGi Enterprise specification compliant JPA based on EclipseLink. With Gemini you don't have to worry about requiring o.e.p.jpa nor do you have to worry about bundle order. Here's the http://www.eclipse.org/forums/index.php/f/153/. The "native" EclipseLink JPA weaving support predates the standard and is deprecated in favour of the OSGi standard approach. So best to start there rather than investing further effort with the deprecated support.

One caution I do have is the use of Spring weaving. Gemini implements the OSGi enterprise spec and uses the OSGi weaving service. Spring likes to do things its own way and I have spoken with one person who had some issues. I'd either embrace an OSGi standards compliant application architecture or Spring's approach--but mixing the two can be painful.

Shaun
Re: EclipseLink weaving fragment require-bundle version [message #787284 is a reply to message #783823] Tue, 31 January 2012 06:54 Go to previous message
Eclipse UserFriend
Hi Shaun,

Thank you so much for your comment, it's the first that convince me to move to Gemini JPA.
I'll try to mix gemini JPA and spring emf/jta resolution (I'm an Atomikos community contributor, and the purpose of this project is to provide a sample).
I'll keep you informed about the feasibility (prorata my knowledge on the subject).

Regards, Charlie
Re: EclipseLink weaving fragment require-bundle version [message #787286 is a reply to message #783823] Tue, 31 January 2012 06:54 Go to previous message
Eclipse UserFriend
Hi Shaun,

Thank you so much for your comment, it's the first that convince me to move to Gemini JPA.
I'll try to mix gemini JPA and spring emf/jta resolution (I'm an Atomikos community contributor, and the purpose of this project is to provide a sample).
I'll keep you informed about the feasibility (prorata my knowledge on the subject).

Regards, Charlie
Previous Topic:NPE in registerObjectForMergeCloneIntoWorkingCopy
Next Topic:composite key order
Goto Forum:
  


Current Time: Tue Jul 01 00:49:32 EDT 2025

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

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

Back to the top