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 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.

...

The main time you want to export only, is if your bundle is purely a library bundle, then its packages will only be used if they are needed. Another case might be if you have tightly coupled bundles sharing implementation packages. However, if your bundle will be started and especially if the exported packages define service interfaces or are referenced from service interfaces, then you will generally want to export and import them.

...