title: OSGI component not being picked up by SCR (ServiceMix)?
body: <p>I am trying to create an OPS4J PAX config DataSource pre-hook to automate database structure integrity checking and updates via Liquibase. According to <a href="https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/tutorial.md" rel="nofollow noreferrer">this tutorial</a>, all I have to do is mark a <code>PreHook</code> implementation with a <code>@Component</code> annotation giving it a name property and reference that property in the DataSource config, which I have done.</p>
  
  <p>The problem seems to be that the component is never picked by the SCR. </p>
  
  <pre class="lang-java prettyprint-override"><code>@Component(property = "name=coredbmigrate")
  public class LiquibaseMigrator implements PreHook {
      public LiquibaseMigrator() {
          System.out.println();
          System.out.println("PREHOOK INITIALIZED");
          System.out.println();
      }
  
      @Override
      public void prepare(DataSource dataSource) throws SQLException {
          System.out.println();
          System.out.println("PREHOOK CALLED");
          System.out.println();
      }
  }
  </code></pre>
  
  <p>As you can see, I have added basic outputs to indicate when the component is intatiated and called, and neither of those ever happen.</p>
  
  <p>The generated <code>OSGI-INF/lv.cps.is.ledger.accounts.db.LiquibaseMigrator.xml</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;component name="lv.cps.is.ledger.accounts.db.LiquibaseMigrator"&gt;
      &lt;implementation class="lv.cps.is.ledger.accounts.db.LiquibaseMigrator"/&gt;
      &lt;service&gt;
          &lt;provide interface="org.ops4j.pax.jdbc.hook.PreHook"/&gt;
      &lt;/service&gt;
      &lt;property name="name" type="String" value="coredbmigrate"/&gt;
  &lt;/component&gt;
  </code></pre>
  
  <p><code>Service-Component</code> header in <code>MANIFEST.MF</code> is also set correctly.</p>
  
  <p>What could be the reason that the component is never instantiated? Or maybe it is but I'm not seeing it?</p>