Bundle configuration for an OSGi application [message #1816834] |
Fri, 08 November 2019 00:17 |
Eclipse User |
|
|
|
I run Eclipse 2019-09 in the Modeling edition and created a "Hello OSGi Bundle" demo application using the plug-in project creation wizard. This is its MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Hello
Bundle-SymbolicName: my.hello
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: my.hello.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.osgi.framework;version="1.3.0"
Automatic-Module-Name: my.hello
Export-Package: my.hello
(1) With the following run configuration, I am able to execute the simple OSGi application and interact with it using the console:
However, although the configuration comprises only a few bundles, a large number of OSGi bundles seems to be executed:
osgi> ss
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.15.0.v20190830-1434
1 ACTIVE my.hello_1.0.0.qualifier
2 ACTIVE com.ibm.icu.source_64.2.0.v20190507-1337
3 ACTIVE com.jcraft.jsch.source_0.1.55.v20190404-1902
4 ACTIVE com.sun.el.source_2.2.0.v201303151357
5 ACTIVE javax.annotation.source_1.2.0.v201602091430
[...]
538 ACTIVE org.w3c.css.sac.source_1.3.1.v200903091627
539 ACTIVE org.w3c.dom.events.source_3.0.0.draft20060413_v201105210656
540 ACTIVE org.w3c.dom.smil.source_1.0.1.v200903091627
541 ACTIVE org.w3c.dom.svg.source_1.1.0.v201011041433
Apart from the bundles that are actually necessary, the name of all the others seem to be "source" bundles. However, I wonder why Eclipse adds all these bundles to the run. Is there any way to prevent it from doing so?
(2) As shown in the above figure, Eclipse considers this a "valid" configuration. However, if I click the "Add Required Bundles" button in the dialog, Eclipse adds a large amount of bundles to the configuration:
It also does this with the "Include optional dependencies..." option disabled. I am also unable to understand how Eclipse calculates these dependencies. Where are they drawn from? Some of these dependencies causes the application to output messages like the following:
!ENTRY org.eclipse.equinox.registry 2 0 2019-11-08 01:11:39.795
!MESSAGE The extensions and extension-points from the bundle "org.eclipse.emf.validation.ui.ide.source" are ignored. The bundle is not marked as singleton.
Is it possible to configure Eclipse sucht that it adds only the bundles that are actually necessary?
|
|
|
|
|
Re: Bundle configuration for an OSGi application [message #1817154 is a reply to message #1817150] |
Sat, 16 November 2019 15:34 |
Eclipse User |
|
|
|
Thank you very much for your helpful answers!
I agree that the forum on PDE-related questions would indeed be a better fit for this topic. My apologies.
Right now, my primary goal is not to build an explicitly small Java application. I am rather trying to develop an understanding of how Eclipse plug-in development works from the ground up. This is why I am a little bit confused with the "magic" that happens during the launch of an OSGi application.
Ed Merks wrote on Sat, 16 November 2019 06:43If you don't want the sources (you certainly won't need them in the runtime launch), you could filter for those, and deselect them.
Unfortunately, the "sources" bundles are not listed in the "Bundles" tab of Run Configuration dialog. Is there maybe another location that I need to check?
Ed Willink wrote on Sat, 16 November 2019 08:40If you really want OSGI, then you can use the show the plugin dependency hierarchy on the Dependencies tab of the MANIFEST.MF editor to see all the dependents of each plugin you specify. It looks as if you have chosen some with perhaps rather bloated dependencies. Try specifying just what you need.
Thank you for the hint. Taking a look at the plug-in dependency hierarchy of the "my.hello" bundle, I can see that the only listed dependency is "org.eclipse.osgi", which itself has a dependency on "org.eclipse.osgi.compatibility.state". Nevertheless, the "Add Required Bundles" button adds a large number of bundles to the run. Do you have any idea where Eclipse might get them from?
|
|
|
Powered by
FUDForum. Page generated in 0.03430 seconds