title: Unresolved requirement: osgi.component
body: <p>I'm trying to develop onto Karaf an OSGi WAB containing a REST API and a call from a custom-made service. However, for some weird reason, the OSGi framework complains about an unsatisfied capability, <code>osgi.component</code>.</p>
  
  <p><strong>I would like to know</strong>:</p>
  
  <ol>
  <li>How can I solve this issue?</li>
  <li>What is <code>osgi.component</code> bundle? Why is needed?</li>
  <li>Why maven-bundle-plugin (thereby also bnd), declares it inside the entry "Require-Capability"?</li>
  <li>If I need to install it on the OSGi framework, where may I find it?</li>
  </ol>
  
  <p>Some additional information:</p>
  
  <ul>
  <li>karaf version: 4.0.7;</li>
  <li>maven bundle plugin: 3.2.0;</li>
  <li>OS: Windows 10 64bit;</li>
  <li>IDE: Eclipse Neon;</li>
  </ul>
  
  <p>Some code to provide additional info:</p>
  
  <p>The whole error:</p>
  
  <blockquote>
    <p>Error executing command: Error executing command on bundles:
            Error starting bundle 96: Unable to resolve com.massimobono.karaf.examples.user-fully-rest [96](R 96.0): missing
    requirement [com.massimobono.karaf.examples.user-fully-rest [96](R
    96.0)] osgi.extender; (&amp;(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))
    Unresolved requirements:
    [[com.massimobono.karaf.examples.user-fully-rest [96](R 96.0)]
    osgi.extender;
    (&amp;(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))]</p>
  </blockquote>
  
  <p>Manifest file:</p>
  
  <pre><code>Manifest-Version: 1.0
  Bundle-SymbolicName: com.massimobono.karaf.examples.user-fully-rest
  Archiver-Version: Plexus Archiver
  Built-By: massi
  Bnd-LastModified: 1479908575162
  Bundle-ActivationPolicy: lazy
  Bundle-ManifestVersion: 2
  Import-Package: com.massimobono.karaf.examples.user;version="[0.0,1)",
   com.massimobono.karaf.examples.user.service;version="[0.0,1)",javax.w
   s.rs;version="[2.0,3)",javax.ws.rs.core;version="[2.0,3)"
  Require-Capability: osgi.extender;filter:="(&amp;(osgi.extender=osgi.compo
   nent)(version&gt;=1.3.0)(!(version&gt;=2.0.0)))",osgi.service;filter:="(obj
   ectClass=com.massimobono.karaf.examples.user.service.UserService)";ef
   fective:=active,osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(version=1.8))"
  Service-Component: OSGI-INF/com.massimobono.karaf.examples.user.ui.ful
   lyrest.UserRest.xml
  Tool: Bnd-3.2.0.201605172007
  Originally-Created-By: Maven Integration for Eclipse
  Export-Package: com.massimobono.karaf.examples.user.ui.fullyrest;uses:
   ="javax.ws.rs,javax.ws.rs.core";version="0.0.1"
  Bundle-Name: user-fully-rest Maven Webapp
  Bundle-Version: 0.0.1.SNAPSHOT
  Created-By: Apache Maven Bundle Plugin
  Build-Jdk: 1.8.0_91
  </code></pre>
  
  <p>Rest base class:</p>
  
  <pre><code>package com.massimobono.karaf.examples.user.ui.fullyrest;
  
  import java.time.LocalDateTime;
  
  import javax.ws.rs.DELETE;
  import javax.ws.rs.GET;
  import javax.ws.rs.PUT;
  import javax.ws.rs.Path;
  import javax.ws.rs.PathParam;
  import javax.ws.rs.Produces;
  import javax.ws.rs.core.MediaType;
  
  import org.osgi.service.component.annotations.Component;
  import org.osgi.service.component.annotations.Reference;
  
  import com.massimobono.karaf.examples.user.User;
  import com.massimobono.karaf.examples.user.service.UserService;
  import com.massimobono.karaf.examples.user.service.UserServiceException;
  
  @Path("user")
  @Component(immediate=true)
  public class UserRest {
  
      @Reference
      private volatile UserService userService;
  
      @GET
      @Produces(MediaType.TEXT_HTML)
      public String getUserNumber() {
          try {
              return String.format("&lt;h1&gt;Total users: %d&lt;/h1&gt;", this.userService.size());
          } catch (UserServiceException e) {
              return String.format("Couldn't fetch total users because %s", e.getMessage());
          }
      }
  
      @PUT
      @Path("add/{name}/{surname}")
      @Produces(MediaType.TEXT_HTML)
      public String add(@PathParam("name") String name, @PathParam("surname") String surname) {
          try {
              User u = new User(name, surname, LocalDateTime.now());
              this.userService.addUser(u);
              return String.format("&lt;h1&gt;New user with id %d&lt;/h1&gt;", u.getId());
          } catch (UserServiceException e) {
              return String.format("&lt;h1&gt;Couldn't fethc total users because %s&lt;/h1&gt;", e.getMessage());
          }
      }
  
      @DELETE
      @Path("remove/{id}")
      @Produces(MediaType.TEXT_HTML)
      public String remove(@PathParam("id") int id) {
          User u;
          try {
              u = this.userService.getUser(id);
              this.userService.removeUser(u);
              return String.format("&lt;h1&gt;User name=%s surname=%s removed correctly&lt;/h1&gt;", u.getName(), u.getSurname());
          } catch (UserServiceException e) {
              return String.format("&lt;h1&gt;Couldn't remove user because %s&lt;/h1&gt;", e.getMessage());
          }
  
      }
  
  }
  </code></pre>
  
  <p>Thanks for any kind reply</p>