Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337219 - Metatype Impl failing CT due to recent change in Bundle Wiring API
Summary: Metatype Impl failing CT due to recent change in Bundle Wiring API
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: John Ross CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 334582
Blocks:
  Show dependency tree
 
Reported: 2011-02-15 09:52 EST by John Ross CLA
Modified: 2011-02-16 16:09 EST (History)
1 user (show)

See Also:


Attachments
initial patch (2.06 KB, patch)
2011-02-15 09:58 EST, Thomas Watson CLA
no flags Details | Diff
Updated patch using BundleWiring findEntries and listResources (3.62 KB, patch)
2011-02-15 13:23 EST, John Ross CLA
no flags Details | Diff
Corrected updated patch using only findEntries (4.10 KB, patch)
2011-02-15 16:20 EST, John Ross CLA
no flags Details | Diff
Corrected complete patch using only findEntries (8.99 KB, patch)
2011-02-16 10:24 EST, John Ross CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Ross CLA 2011-02-15 09:52:10 EST
Build Identifier: 

The Metatype Service implementation is currently failing the CT due to a recent change in the Bundle Wiring API where the getFragmentRevisions() method was removed. This needs to be fixed and the RI updated.

java.lang.NoSuchMethodError: org.osgi.framework.wiring.BundleWiring.getFragmentRevisions()Ljava/util/List;
at org.eclipse.equinox.metatype.FragmentUtils.findEntryPaths(FragmentUtils.java:42)
at org.eclipse.equinox.metatype.MetaTypeProviderImpl.readMetaFiles(MetaTypeProviderImpl.java:88)
at org.eclipse.equinox.metatype.MetaTypeProviderImpl.<init>(MetaTypeProviderImpl.java:56)
at org.eclipse.equinox.metatype.MetaTypeInformationImpl.<init>(MetaTypeInformationImpl.java:36)
at org.eclipse.equinox.metatype.MetaTypeServiceImpl$1.run(MetaTypeServiceImpl.java:76)
at org.eclipse.equinox.metatype.MetaTypeServiceImpl$1.run(MetaTypeServiceImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.equinox.metatype.MetaTypeServiceImpl.getMetaTypeProvider(MetaTypeServiceImpl.java:74)
at org.eclipse.equinox.metatype.MetaTypeServiceImpl.getMetaTypeInformation(MetaTypeServiceImpl.java:52)
at org.osgi.test.cases.metatype.junit.AdMinOnlyTest.setUp(AdMinOnlyTest.java:130)
at junit.framework.TestCase.runBare(TestCase.java:128)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at aQute.junit.Activator.test(Activator.java:200)
at aQute.junit.Activator.automatic(Activator.java:97)
at aQute.junit.Activator.run(Activator.java:47)


Reproducible: Always
Comment 1 Thomas Watson CLA 2011-02-15 09:58:09 EST
Created attachment 189007 [details]
initial patch

Here is a quick patch that migrates to using BundleWire objects from the osgi.wiring.host namespace to discover fragment revisions.  I think we should consider changing the code to using BundleWiring.findEntries instead.
Comment 2 John Ross CLA 2011-02-15 13:23:16 EST
Created attachment 189030 [details]
Updated patch using BundleWiring findEntries and listResources

Here is an updated patch that uses BundleWiring.findEntries and listResources. Tested against the CT.
Comment 3 John Ross CLA 2011-02-15 16:20:17 EST
Created attachment 189045 [details]
Corrected updated patch using only findEntries

We don't want classpath scanning.
Comment 4 Thomas Watson CLA 2011-02-16 09:58:41 EST
(In reply to comment #3)
> Created attachment 189045 [details]
> Corrected updated patch using only findEntries
> 
> We don't want classpath scanning.

Is this the complete patch.  When applied to head I get a compile error in 

org.eclipse.equinox.metatype.MetaTypeProviderImpl.readMetaFiles(Bundle, SAXParserFactory)

To a call to the old FragmentUtils.findEntryPaths method.
Comment 5 John Ross CLA 2011-02-16 10:24:21 EST
Created attachment 189105 [details]
Corrected complete patch using only findEntries

The previous patch only included FragmentUtils changes. Needed the MetatypeProviderImpl changes as well.
Comment 6 Thomas Watson CLA 2011-02-16 16:09:04 EST
I released the patch.