Questions tagged [osgi-fragment]
60 questions
14
votes
2 answers
When is an OSGi fragment attached to host?
I have an OSGi bundle with persistence service (using hibernate) and a fragment, which contains configuration (xml file). In bundle's activator, I'm loading the configuration using:
@Override
public void start(BundleContext ctx) {
URL url =…

Kojotak
- 2,020
- 2
- 16
- 29
8
votes
1 answer
How to get a Fragment-Bundle into Tycho test runtime?
I have an implementation bundle and fragment bundle dependent on it (Fragment-Host in MANIFEST). Moreover, there is a bundle with some tests.
Now I want to test my implementation and use the tycho-surefire-plugin. The bundle with tests refers to the…

Anna
- 233
- 2
- 8
6
votes
1 answer
Installing a fragment requires a refresh on the host, how can this be avoided?
I have two bundles: bundle A and bundle B which is configured as a fragment of bundle A using:
Fragment-Host:
Whenever I install bundle B it fails to start (INSTALLED) and therefore to attach itseld to bundle A.
At this point when I check bundle…

Joly
- 3,218
- 14
- 44
- 70
6
votes
1 answer
"Unsatisfied native code filter" error when trying to export OSGi fragment in Eclipse with custom vm arg
There seems to be only one other question of this nature, here, but the solution suggested by that answer hasn't been effective for me. I am using Spring Tool Suite (essentially Kepler 4.3.2 SR2) as my IDE to develop an OSGi fragment that contains…

Meadowlark Bradsher
- 365
- 1
- 16
6
votes
3 answers
How to use OSGi fragments to contribute platform-dependent native code with the same filename?
I am using the JNotify project to listen to file system events. This depends on one native library per OS:processor architecture. For example, there's one library for Windows x86, one library for x86-64 etc.
Monolithic bundle
Originally, I had one…

Dan Gravell
- 7,855
- 7
- 41
- 64
5
votes
1 answer
Fragment dependency on other fragments
I have a plugin which is the host of fragment A & B. I export a package using Export-Package header from fragment A. Hopefully I can import that package in fragment B using Import-Package header. But the PDE reports that the dependency is…

SetNug
- 331
- 1
- 2
- 13
5
votes
1 answer
Constraints from the fragment conflict with the host
I am trying to extend the imports of bundle A from bundle B using Fragment-Host.
In bundle B I have this line: Fragment-Host:
and in bundle B's Import-Package I have added the imports required by bundle A
When I try to update bundle B with the…

Joly
- 3,218
- 14
- 44
- 70
5
votes
2 answers
SecurityException when running plain JUnit + Mockito in Eclipse RCP Project
I have an Eclipse RCP Project with multiple plugins. I am writing plain JUnit tests (no dependencies to Eclipse/UI) as separate fragments to the plugin-under-test.
When using Mockito and trying to mock an interface from another plugin (which is…

jhyot
- 3,733
- 1
- 27
- 44
5
votes
1 answer
How do I patch an eclipse plug-in using a fragment plugin and deploy it in my eclipse product?
I'm trying to apply a patch to an existing plug-in using a fragment plugin as described here:
Steps to use Fragments to patch a plug-in - Eclipsepedia
The patch to the host plugin involves replacing a single class file with an updated class file.…

betamax
- 116
- 1
- 9
5
votes
1 answer
Osgi eclipse: how to export package from a fragment bundle and make them visible to an external bundle?
Starter situation (without any error):
I have three different bundles: bunbdle A (called org.apache.xmlbeans), bundle B and bundle C
bundle B import some packages exported from the bundle A
bundle B export some packages (e.g. the package…

Andrea
- 91
- 6
5
votes
2 answers
Tycho cannot resolve fragment dependency on other fragment
I want to create an extension for org.eclipse.swt as a fragment. I have created a bundle swt.extension with the following MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Extension
Bundle-SymbolicName:…

ZhekaKozlov
- 36,558
- 20
- 126
- 155
5
votes
3 answers
Using the OSGi API, how do I find out if a given bundle is a fragment?
In the OSGi API, a call to BundleContext.getBundles() returns all bundles, whether they are fragments or not. For a given Bundle object, what is the best way to tell if this is a fragment or not?

Dan Gravell
- 7,855
- 7
- 41
- 64
4
votes
1 answer
Component inside a fragment never activated
When I create a component inside a fragment using OSGi Declarative Service way this component is not getting activated but my components in host bundle gets activated.
Am I missing something? My fragment has proper meta-inf file entry for host…

Questionevrything
- 239
- 4
- 12
3
votes
1 answer
How to overcome "Missing optionally imported package"issue in OSGi
I wrote an OSGi bundle using "maven-bundle-plugin"(where i try to make the "jruby-complete-1.4.0.jar" as osgi bundle, note that only dependency is "jruby-complete-1.4.0.jar")..When i check the bundle via osgi console using diag command( #diag XX)…

Ratha
- 9,434
- 17
- 85
- 163
3
votes
2 answers
Can OSGi fragments have other fragments as hosts?
Is this legal?
MANIFEST.MF for org.fragment1 (org.host is a normal bundle, not a fragment):
Bundle-SymbolicName: org.fragment1
Fragment-Host: org.host
MANIFEST.MF for org.fragment2:
Bundle-SymbolicName: org.fragment2
Fragment-Host:…

Alexey Romanov
- 167,066
- 35
- 309
- 487