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

Bug 331898

Summary: Resources are not loaded from ACTIVE bundles
Product: [RT] Gemini.JPA Reporter: Nick Wilson <nickwi>
Component: CoreAssignee: Michael Keith <michael.keith>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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. ***