Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331898 - Resources are not loaded from ACTIVE bundles
Summary: Resources are not loaded from ACTIVE bundles
Status: RESOLVED WORKSFORME
Alias: None
Product: Gemini.JPA
Classification: RT
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Michael Keith CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 331901 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-06 09:06 EST by Nick Wilson CLA
Modified: 2010-12-16 17:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Wilson CLA 2010-12-06 09:06:37 EST
This affects the loading of persistence.xml files from bundles that are in the ACTIVE state preventing persistence units being registered by GeminiOSGiInitializer.registerBundle(). Tested with gemini JPA 1.0.0M3 under Felix 3.0.6.

The BundleProxyClassLoader.findResources(String name) (and getResource()) method only looks at bundles in the INSTALLED and UNINSTALLED states. Shouldn't it be looking at ACTIVE bundles rather than UNINSTALLED.

Changing UNINSTALLED to ACTIVE seems to fix it and allows the persistence units to register and function correctly.
Comment 1 Michael Keith CLA 2010-12-06 10:13:31 EST
This is actually a problem that is a result of a bug in Felix. Gemini JPA refreshes persistence unit bundles that have already been installed before gemini was active, and then waits for the UNRESOLVED event to do its work in the pre-resolve stage. Felix has a bug in that it does not fire the UNRESOLVED event (see https://issues.apache.org/jira/browse/FELIX-2456), which causes Gemini to not find the bundle. Unfortunately, adding the processing to the ACTIVE state is going to be too late to do the weaving, but might work if you do not do any weaving.
Comment 2 Michael Keith CLA 2010-12-06 11:04:08 EST
Moving to new bin location.
Comment 3 Michael Keith CLA 2010-12-16 17:14:24 EST
The bug in Felix that causes this has been fixed in the latest Felix SNAPSHOTS and will be included in the next release.
Comment 4 Michael Keith CLA 2010-12-16 17:16:31 EST
*** Bug 331901 has been marked as a duplicate of this bug. ***