0

I'm using Bndtools plugin under Eclipse Mars. In a project I need the Apache FileInstall bundle and I have selected it in the "Run Requirements" under the Run descriptor. The bundle is active.

I can't understand how to get the current parameters for FileInstall like poll, directory to watch for config file and so on so I don't know where to put the config file for my class that implement ManagedService.

If I try to add the following line under VM arguments ...

-Dfelix.fileinstall.dir=/home/ppatierno/Downloads

the Config Admin service goes in the Stopping state after few seconds.

If I don't add the FileInstall bundle under "Run Requirements" but install and start it from apache felix console, it starts and becomes active but doesn't print the main configuration above properties.

Any idea ?

ppatierno
  • 9,431
  • 1
  • 30
  • 45
  • I have just tried to start Apache Felix from console without Eclipse. Install and start my bundle, the config admin and the fileinstall bundles. Using the following line : java -Dfelix.fileinstall.dir=/home/ppatierno -jar bin/felix.jar the framework starts but after few seconds executing a simple "lb" command I receive an exception on executing the command – ppatierno Dec 19 '15 at 18:12
  • The FileInstall bundle works great if I put the config file in a "load" directory (it's the default) ... but I can't change the default directory :-( – ppatierno Dec 19 '15 at 18:27

1 Answers1

0

I'm not sure if this helps you. What I did to use FileInstaller was following:

I deploy a feature like:

<feature name="myFeature" version="${myproject.version}">        
    <configfile finalname="/my/path/myConfig.cfg" override="false">mvn:my.group/artifact.with.the.conf.file.in.nexus/${myproject.version}/cfg/configuration</configfile>
    <bundle>mvn:my.group/artifact.with.the.feature.impl/${project.version}</bundle>
</feature>

This copy a configuration file in my/path/ then the file is deploy as a service with name myConfig. Then to get the updates I register it when the configurator (ManagedService) starts, like this:

    Hashtable <String, Object> properties = new Hashtable<String, Object>();
    properties.put(Constants.SERVICE_PID, "myConfig");
    myService = context.registerService (ManagedService.class.getName(),this , properties);
ender.an27
  • 703
  • 1
  • 13
  • 35