{"action":"closed","issue":{"url":"https://api.github.com/repos/bndtools/bnd/issues/1030","labels_url":"https://api.github.com/repos/bndtools/bnd/issues/1030/labels{/name}","comments_url":"https://api.github.com/repos/bndtools/bnd/issues/1030/comments","events_url":"https://api.github.com/repos/bndtools/bnd/issues/1030/events","html_url":"https://github.com/bndtools/bnd/issues/1030","id":101038833,"number":1030,"title":"BUG no metatype files generated","user":{"login":"fhuberts","id":635705,"avatar_url":"https://avatars.githubusercontent.com/u/635705?v=3","gravatar_id":"","url":"https://api.github.com/users/fhuberts","html_url":"https://github.com/fhuberts","followers_url":"https://api.github.com/users/fhuberts/followers","following_url":"https://api.github.com/users/fhuberts/following{/other_user}","gists_url":"https://api.github.com/users/fhuberts/gists{/gist_id}","starred_url":"https://api.github.com/users/fhuberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhuberts/subscriptions","organizations_url":"https://api.github.com/users/fhuberts/orgs","repos_url":"https://api.github.com/users/fhuberts/repos","events_url":"https://api.github.com/users/fhuberts/events{/privacy}","received_events_url":"https://api.github.com/users/fhuberts/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-14T15:43:23Z","updated_at":"2015-08-14T16:20:59Z","closed_at":"2015-08-14T16:20:59Z","body":"I'm on latest bndtools.\r\n\r\nI've converted a project from bnd annotations to (R6) DS annotations.\r\n\r\nNow the /OSGI-INF/metatype is no longer generated.\r\n\r\nI've selected 'DS 1.2 Annotations' the bndtool bnd file editor, which replaces 'Service-Component: *' with '-dsannotations: *'.\r\nI've also converted the classes to use the R6 metatype aanotations, see patch below.\r\n\r\nRather critical since it all falls over now.\r\n\r\n```\r\ndiff --git a/nl.mindef.ahr.ahrwand.egress/bnd.bnd b/nl.mindef.ahr.ahrwand.egress/bnd.bnd\r\nindex ab7531a..e51c93f 100644\r\n--- a/nl.mindef.ahr.ahrwand.egress/bnd.bnd\r\n+++ b/nl.mindef.ahr.ahrwand.egress/bnd.bnd\r\n@@ -2,12 +2,10 @@ Bundle-Name:AHR WAND Egress\r\n Bundle-Version:1.0.0.${tstamp}\r\n Private-Package: \\\r\n \tnl.mindef.ahr.ahrwand.egress\r\n-Service-Component: \\\r\n-\t*\r\n+-dsannotations: *\r\n -buildpath: \\\r\n \tosgi.core;version=${osgi.core.version},\\\r\n \tosgi.cmpn;version=${osgi.cmpn.version},\\\r\n-\tbiz.aQute.bnd.annotation,\\\r\n \tnl.mindef.ahr.common.types;version=latest,\\\r\n \tnl.mindef.ahr.gateway.reporter.api;version=latest,\\\r\n \tnl.mindef.ahr.util;version=project\r\n@@ -15,5 +13,4 @@ Service-Component: \\\r\n \t${junit},\\\r\n \tnl.mindef.ahr.testmocks;version=project\r\n Conditional-Package: \\\r\n-\tnl.mindef.ahr.util.trigger,\\\r\n-\taQute.bnd.annotation.metatype\r\n\\ No newline at end of file\r\n+\tnl.mindef.ahr.util.trigger\r\n\\ No newline at end of file\r\ndiff --git a/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/AhrWandEgress.java b/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/AhrWandEgress.java\r\nindex b7bfa88..8f52a06 100644\r\n--- a/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/AhrWandEgress.java\r\n+++ b/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/AhrWandEgress.java\r\n@@ -14,21 +14,22 @@ import java.util.concurrent.atomic.AtomicLong;\r\n import java.util.regex.Matcher;\r\n import java.util.regex.Pattern;\r\n \r\n+import org.osgi.service.component.annotations.Activate;\r\n+import org.osgi.service.component.annotations.Component;\r\n+import org.osgi.service.component.annotations.Deactivate;\r\n+import org.osgi.service.component.annotations.Modified;\r\n+import org.osgi.service.component.annotations.Reference;\r\n import org.osgi.service.log.LogService;\r\n+import org.osgi.service.metatype.annotations.Designate;\r\n \r\n-import aQute.bnd.annotation.component.Activate;\r\n-import aQute.bnd.annotation.component.Component;\r\n-import aQute.bnd.annotation.component.Deactivate;\r\n-import aQute.bnd.annotation.component.Modified;\r\n-import aQute.bnd.annotation.component.Reference;\r\n-import aQute.bnd.annotation.metatype.Configurable;\r\n import nl.mindef.ahr.common.types.Bandwidth;\r\n import nl.mindef.ahr.gateway.reporter.api.Gateway;\r\n import nl.mindef.ahr.gateway.reporter.api.GatewayReporter;\r\n import nl.mindef.ahr.util.trigger.TriggerTarget;\r\n import nl.mindef.ahr.util.trigger.TriggerTask;\r\n \r\n-@Component(designate = Config.class, provide = {})\r\n+@Component(service = {})\r\n+@Designate(ocd = Config.class)\r\n public class AhrWandEgress implements TriggerTarget {\r\n   /*\r\n    * Services\r\n@@ -53,9 +54,9 @@ public class AhrWandEgress implements TriggerTarget {\r\n    */\r\n \r\n   @Activate\r\n-  void activate(final Map<String, Object> props) {\r\n+  void activate(final Config config) {\r\n     synchronized (this.configContainerLock) {\r\n-      this.setupConfig(props);\r\n+      this.config = config;\r\n     }\r\n \r\n     this.timer = new Timer(this.getClass().getSimpleName());\r\n@@ -82,20 +83,12 @@ public class AhrWandEgress implements TriggerTarget {\r\n   private final Object configContainerLock = new Object();\r\n   private Config       config              = null;\r\n \r\n-  /* MUST be called in a synchronized (configContainerLock) block */\r\n-  private Config setupConfig(final Map<String, Object> props) {\r\n-    final Config prevConfig = this.config;\r\n-    this.config = Configurable.createConfigurable(Config.class, props);\r\n-    return prevConfig;\r\n-  }\r\n-\r\n   @Modified\r\n-  void modified(final Map<String, Object> props) {\r\n+  void modified(final Config config) {\r\n     Config previousConfig;\r\n-    Config config;\r\n     synchronized (this.configContainerLock) {\r\n-      previousConfig = this.setupConfig(props);\r\n-      config = this.config;\r\n+      previousConfig = this.config;\r\n+      this.config = config;\r\n     }\r\n \r\n     if (!previousConfig.ahrwandEgressFile().equals(config.ahrwandEgressFile())) {\r\ndiff --git a/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/Config.java b/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/Config.java\r\nindex 92958c6..5e49a9a 100644\r\n--- a/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/Config.java\r\n+++ b/nl.mindef.ahr.ahrwand.egress/src/nl/mindef/ahr/ahrwand/egress/Config.java\r\n@@ -1,21 +1,22 @@\r\n package nl.mindef.ahr.ahrwand.egress;\r\n \r\n-import aQute.bnd.annotation.metatype.Meta;\r\n+import org.osgi.service.metatype.annotations.AttributeDefinition;\r\n+import org.osgi.service.metatype.annotations.ObjectClassDefinition;\r\n \r\n-@Meta.OCD(name = \"AHR WAND Egress\", description = \"Configuration for the AHR WAND Egress service\")\r\n-public interface Config {\r\n-  static final String DEFAULT_EGRESS_FILE         = \"/var/run/ahrplefe-sgw-egress.conf\";\r\n+@ObjectClassDefinition(name = \"AHR WAND Egress\", description = \"Configuration for the AHR WAND Egress service\")\r\n+@interface Config {\r\n+  static final String DEFAULT_EGRESS_FILE = \"/var/run/ahrplefe-sgw-egress.conf\";\r\n   static final String DEFAULT_QUERY_INTERVAL_MSEC = \"1000\";\r\n \r\n   /*\r\n    * Querier\r\n    */\r\n \r\n-  @Meta.AD(deflt = DEFAULT_EGRESS_FILE, required = false,\r\n+  @AttributeDefinition(defaultValue = DEFAULT_EGRESS_FILE, required = false,\r\n       description = \"The AHR WAND Egress file (default = \" + DEFAULT_EGRESS_FILE + \")\")\r\n   String ahrwandEgressFile();\r\n \r\n-  @Meta.AD(min = \"1000\", deflt = DEFAULT_QUERY_INTERVAL_MSEC, required = false,\r\n+  @AttributeDefinition(min = \"1000\", defaultValue = DEFAULT_QUERY_INTERVAL_MSEC, required = false,\r\n       description = \"The interval on which to query the network (msec) (default = \" + DEFAULT_QUERY_INTERVAL_MSEC + \")\")\r\n   int queryIntervalMilliSeconds();\r\n }\r\n\\ No newline at end of file\r\n```"}}