1

Based on Configurator Specification in OSGI Compendium we can specify configuration using json files.

It is also mentioned that default config location can be changed from OSGI-INF/configurator to other places using @RequireConfigurator("resources/configs").

But it didn't work for me, I'm not sure if I'm missing something. Below a screenshot that shows where file is located and also the content of package-info.java

enter image description here

Yazid
  • 108
  • 3
  • 12

1 Answers1

1

Does your bundle contain the folder "resources/configs"?

Did you make sure to -includeresource that folder into your bundle under the name "resources/configs"?

For example:

-includeresource: resources=src/main/resources

BJ Hargrave
  • 9,324
  • 1
  • 19
  • 27
  • Thanks @BJ. Yes it is, after reading felix configurator code i've been able to make it works this morning. The solution was to use "/configs/" but it seems that it depends on the classpath – Yazid Jul 23 '18 at 11:59
  • Is there any possibility to make this config external – Yazid Jul 23 '18 at 12:44
  • 1
    Just the initial configuration can be external: https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html#d0e132120. Otherwise, the whole point is that bundles contain configuration resources. There is provision in the spec for configuration resource to exist in repositories, https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html#d0e132411, but there is not currently any mechanism in the spec for installing those configuration resources in a framework. – BJ Hargrave Jul 24 '18 at 12:39
  • Yes this is the answer that i was waiting for. Thanks @BJ – Yazid Jul 24 '18 at 12:44