Developers, Developers, Developers! Maksim Sorokin IT Blog

11Aug/11Off

Apache Felix: Running Two Instances of Felix Launcher in The Eclipse

This is a next post in Maven + Apache Felix + CXF + DOSGi series.

As was shown in the first post, one my have a separate project for Apache Felix in conveniently launch it using Eclipse.

You need to have two instance of Apache Felix running in the same Eclipse, for example if you are testing DOSGi remote services between different OSGi instances.

First, you will need to have two Apache Felix configurations. The first one can be default: conf\config.properties:

felix.auto.deploy.action=install,start
felix.log.level=1

org.osgi.framework.storage.clean=onFirstInit

felix.auto.start.1 = ...

Then you need to have second one for the second instance. Let's create it here: conf\secondConfig.properties:

felix.auto.deploy.action=install,start
felix.log.level=1

org.osgi.framework.storage.clean=onFirstInit

org.osgi.service.http.port=8081
org.osgi.framework.storage=secondCache

felix.auto.start.1= ...

Note org.osgi.service.http.port and org.osgi.framework.storage. Former is needed to tell OSGi to use different http port. The latter one specifies different cache for OSGi bundle (by default it is felix-cache), which is used to contain all started bundles.

Then the start configuration is the same as was described in the first post. For the second configuration one has to provide a location of conf\secondConfig.properties. In "VM arguments" specify:

-Dfelix.config.properties=file:conf/secondConfig.properties
Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.