Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344951

Summary: Patch proposal for issue with generation of fragment bundles
Product: [RT] Gemini.JPA Reporter: Eduard Bartsch <eduard.bartsch>
Component: CoreAssignee: Michael Keith <michael.keith>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: krum.tsvetkov, shaun.smith
Version: 1.0.0Flags: michael.keith: iplog+
Target Milestone: 1.1.0 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch proposal none

Description Eduard Bartsch CLA 2011-05-06 07:15:45 EDT
Hi,

I had a talk with Shaun that there is an unsolved issue in EclipseLinkOSGiProvider with regard to generation and installation of fragments. 

Here is the code fragment with an extender call that is commented out because it generates an exception:
    public void assignPersistenceUnitsInBundle(Bundle b, Collection<PUnitInfo> pUnits) {
        ...

        // TODO Problem installing fragments in PDE
        // Generate a fragment for the p-units
        //Bundle result = extender.generateAndInstallFragment(b, pUnits);
    }

I am attaching a patch where the exception doesn't occur anymore and the bundle fragment is succesfully installed (state==INSTALLED).

I am not familiar with Gemini JPA well enough to judge whether it solves the issue completely but hope that the proposed patch is helpful.

Best regards, Ed
Comment 1 Eduard Bartsch CLA 2011-05-06 07:16:36 EDT
Created attachment 194922 [details]
Patch proposal

Here is the proposed patch.
Comment 2 Michael Keith CLA 2011-05-06 10:13:43 EDT
Dunno, but I'll give it a shot.
Thanks, Eduard.
Comment 3 Michael Keith CLA 2011-05-06 15:58:29 EDT
Hehe. The PDE error lead to believe that it was having a problem finding the fragment so we didn't look any harder. Looks like the problem was just the extra brackets on a version that was not a range!

Not sure if this code is actually going to stay in or not, but at any rate, fragment creation seems to work :-). Thanks for the eye.