On 9/1/14, 11:01 , Balázs Zsoldos wrote:
The system bundle exports in Felix are defined by the defaults.properties
file found inside the JAR, so it’s not necessary to use the Export-Package
header from the manifest.

I know. I saw it. The packages are also defined in the Export-Package
MANIFEST header. I do not understand why the packages that are listed in
the MANIFEST of a bundle have to even be specified in any configuration.
They are exported by a bundle directly, even if it is the system bundle.

The framework is not a bundle. The fact that it has an Export-Package manifest entry is purely because it is packaged by Maven Bundle Plugin. Those bundle-related entries should probably be removed to avoid confusion like yours.


Equinox uses profiles as well, but the packages that are exported directly
by equinox, do not have to be specified anywhere else.

I think the spec says something about using a reasonable default if nothing is specified...not sure if it defines what that default it, but I don't think so.


If I have to write a custom launcher that analyzes the MANIFEST of felix
JAR and add the exported packages to the system classpath programmatically,
it seems like a workaround of an unfixed bug to me.

I'm not sure there'd be much analyzing going on, just load the default.properties file and use the system.packages value minus the JRE variable as your system.packages value for your launcher.

However, I agree that it could be easier. What might possibly be better is just somehow allowing the ${jre-?} property to be overwritten in the config properties so you could set it to empty or whatever. Currently, it is not possible to override default configuration properties with system properties.



Logic game:

If I create a fragment of the system bundle that exports additional
packages, shall I list those packages in extra configuration as well? If
not, why not? The packages of the host bundle is exported only if I
configure it externally.

This has nothing to do with anything in this discussion. System bundle fragments are handled at run time are their handling is defined by the spec.

-> richard


Regards,
Balazs



On Mon, Sep 1, 2014 at 4:44 PM, Neil Bartlett <[email protected]> wrote:

The system bundle exports in Felix are defined by the defaults.properties
file found inside the JAR, so it’s not necessary to use the Export-Package
header from the manifest. Actually Equinox works in almost exactly the same
way; it uses a bunch of J2SE-*.profile files.

You can always write your own launcher that overrides the default
behaviour. For example the bnd launcher does look for and use the
Export-Package headers from all JARs that are added to the system classpath
using -runpath.

Neil

On 1 September 2014 at 15:29:33, Balázs Zsoldos ([email protected])
wrote:

Hi,

this question might have been raised before. If you could drop a link to
the thread, that would be cool.

In case Equinox is started with an empty
*org.osgi.framework.system.packages* value, the packages of OSGi core are
available in the container. This is good in my opinion as the bundle of
Equinox exports these packages.

If I do the same with Felix, the packages that are specified in the
Export-Package MANIFEST header of felix JAR, are not available. Why is
that? These packages are exported by a bundle, the system bundle.

I normally override the system.packages to use only those packages from
the
JDK that are necessary. I use everything I can from bundles, even the JDBC
API. It is very annoying that I have to list all OSGi core packages in the
system.packages with versions. What if I upgrade felix? I have to check
the
package of every version again. I cannot make a felix version independent
configuration.

Thanks and regards,
*Balázs **Zsoldos*




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to