osgi-fragment

How to get a Fragment-Bundle into Tycho test runtime?

倖福魔咒の 提交于 2019-12-12 10:50:50
问题 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 implementation bundle by means of Require-Bundle in MANIFEST. So far so good. The question is how do I get the fragment bundle into the test runtime? I have tried the dependency in the configuration of the tycho-surefire-plugin in my eclipse-test

OSGi - running outside eclipse

旧时模样 提交于 2019-12-11 08:23:27
问题 I have been working on getting my OSGi application to run outside eclipse. It has certainly wasn't as easy as I thought out would be certainly not just a case of running java -jar org.eclipse.osgi_3.7.1.jar and installing the plugins. I'm hoping this is the last problem java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/ This works fine in Eclipse. I have a persistence bundle and several fragmentation bundles that I load depending on the database type that I

Constraints from the fragment conflict with the host

大兔子大兔子 提交于 2019-12-07 08:20:40
问题 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 manifest and start it I am getting the error: "Constraints from the fragment conflict with the host" with a list of all the imports exist in bundle B however when examining the Manifest of bundle A I don't see why these imports should conflict if they

Component inside a fragment never activated

不想你离开。 提交于 2019-11-30 09:02:38
问题 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 bundle symbolic name. I declare a componet in this way @Component(immediate = true) 回答1: Because bundle fragments are never started, only resolved, declarative services components in them are never activated. The specification specifically states that

When is an OSGi fragment attached to host?

不羁岁月 提交于 2019-11-29 01:37:28
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 = ctx.getBundle().getResource("hibernate.cfg.xml"); SessionFactory sessionFactory = new AnnotationConfiguration().configure(url).buildSessionFactory(); } but sometimes, the URL is null. When I've tried to list all available URL s (using findEntries method), it appeared that the bundle's own ones are available always, but the fragment ones only sometimes. I'm

How to use OSGi fragments to contribute platform-dependent native code with the same filename?

坚强是说给别人听的谎言 提交于 2019-11-28 03:54:35
问题 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 bundle that contained both the JNotify Java classes and the native code. The native code were declared in Bundle-NativeCode as follows: (I've formatted these in the bnd style for better readibility... obviously the actual MANIFEST.MF files are

When is an OSGi fragment attached to host?

允我心安 提交于 2019-11-27 16:06:20
问题 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 = ctx.getBundle().getResource("hibernate.cfg.xml"); SessionFactory sessionFactory = new AnnotationConfiguration().configure(url).buildSessionFactory(); } but sometimes, the URL is null. When I've tried to list all available URL s (using findEntries method),