Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344951 - Patch proposal for issue with generation of fragment bundles
Summary: Patch proposal for issue with generation of fragment bundles
Status: RESOLVED FIXED
Alias: None
Product: Gemini.JPA
Classification: RT
Component: Core (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.1.0 M1   Edit
Assignee: Michael Keith CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 07:15 EDT by Eduard Bartsch CLA
Modified: 2011-05-06 15:58 EDT (History)
2 users (show)

See Also:
michael.keith: iplog+


Attachments
Patch proposal (1.70 KB, patch)
2011-05-06 07:16 EDT, Eduard Bartsch CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.