Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Frequently Asked Questions

Table of Contents
locationtop
styledisc

Why do I get an "Unknown protocol: http" exception when I run Felix on a non-Sun JRE?

Felix installs the URL Handlers service by default. If you do not want this service you can disable it, by setting the felix.service.urlhandlers property to false in the config.properties file. It is not recommended to disable this, but the main reason for doing so it because the URL Handlers implementation invokes methods to set the singleton factories for URL stream and content handler factories. Assuming that you want to use URL Handlers service, you must configure it if you aren't running on the standard Sun JRE.

...

There are two ways to set these system properties. The first way is using the standard -D<property>=<value> syntax when executing java or if you are using Felix' standard Main.java launcher, you can put the system properties into the conf/system.properties file so that they get set automatically each time you execute Felix.

Should a service provider/consumer bundle be packaged with its service API packages?

There is no easy answer to this question and it largely depends on the specific usage scenario. The OSGi specification had originally suggested that it was good practice to embed service API packages in the service provider bundle. In this case in OSGi R4, the service provider should both export and import the service API packages, which was the default for previous versions of the OSGi specification.

...

Anchor
import-and-export
import-and-export

Should a bundle import its own exported packages?

In OSGi R3 this was always the case, since Export-Package implied Import-Package. It was a good idea then and is generally a good idea now.

...