title: OSGI service component dependency couldn't resolved
body: <p>I need to implement a calculator program in OSGI. For that I have created three bundles of jar called calculator api, calculator implementation and calculator bundle named as <code>cala-1.0.0.jar</code>, <code>cali-1.0.0.jar</code>, and <code>calb-1.0.0.jar</code>. </p>
  
  <p>Within the calculator bundle class like this:</p>
  
  <pre><code>package org.cal.bun;
  
              import org.cal.api.calapi;
  
              //import org.osgi.service.component.ComponentContext;
              import org.eclipse.osgi.framework.console.CommandInterpreter;
              import org.eclipse.osgi.framework.console.CommandProvider;
  
              /**
               * The Declarative Service Component for Hello Service
               *
               * @scr.component name="org.cal.bun.calculatorservice"
               * immediate="true"
               * @scr.reference name="org.wso2.cal"
               * interface="org.cal.api.calapi"
               * cardinality="1..1"
               * policy="static"
               * bind="bindcalapi"
               * unbind="unbindcalapi"
               */
  
              public class calculatorservice implements CommandProvider{
  
                private calapi s;
  
  
                  public synchronized void bindcalapi(calapi s) {
                      this.s = s;
                  }
  
                  public synchronized void unbindcalapi(calapi s) {
                      this.s = null;
                  }
  
                  public synchronized void _run(CommandInterpreter ci) {
                      if (s != null) {
                          System.out.println("hi");
                      } else {
                          ci.println("Error, No Service of type Sayable available");
                      }
                  }
  
                  @Override
                  public String getHelp() {
                      return null;
                  }
  </code></pre>
  
  <p>and the <code>pom.xml</code> file is like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0     http://maven.apache.org/xsd/maven-4.0.0.xsd http://www.osgi.org/xmlns/scr/v1.0.0"&gt;
          &lt;parent&gt;
              &lt;artifactId&gt;cal&lt;/artifactId&gt;
              &lt;groupId&gt;org.wso2.com&lt;/groupId&gt;
              &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;/parent&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
          &lt;artifactId&gt;calb&lt;/artifactId&gt;
          &lt;packaging&gt;bundle&lt;/packaging&gt;
  
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.eclipse.osgi&lt;/groupId&gt;
                  &lt;artifactId&gt;org.eclipse.osgi&lt;/artifactId&gt;
                  &lt;version&gt;3.9.1.v20130814-1242&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.eclipse.osgi&lt;/groupId&gt;
                  &lt;artifactId&gt;org.eclipse.osgi.services&lt;/artifactId&gt;
                  &lt;version&gt;3.3.100.v20130513-1956&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wso2.com&lt;/groupId&gt;
                  &lt;artifactId&gt;cala&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
  
  
          &lt;/dependencies&gt;
  
          &lt;repositories&gt;
              &lt;repository&gt;
                  &lt;id&gt;wso2-nexus&lt;/id&gt;
                  &lt;name&gt;WSO2 internal Repository&lt;/name&gt;
                  &lt;url&gt;http://maven.wso2.org/nexus/content/groups/wso2-public/&lt;/url&gt;
                  &lt;releases&gt;
                      &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;updatePolicy&gt;daily&lt;/updatePolicy&gt;
                      &lt;checksumPolicy&gt;ignore&lt;/checksumPolicy&gt;
                  &lt;/releases&gt;
              &lt;/repository&gt;
          &lt;/repositories&gt;
  
  
          &lt;build&gt;
  
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-scr-plugin&lt;/artifactId&gt;
                      &lt;version&gt;1.7.2&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;generate-scr-scrdescriptor&lt;/id&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;scr&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
  
                      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.3.5&lt;/version&gt;
                      &lt;extensions&gt;true&lt;/extensions&gt;
  
                      &lt;configuration&gt;
  
                          &lt;instructions&gt;
  
                              &lt;Bundle-Vendor&gt;Sample Inck&lt;/Bundle-Vendor&gt;
                              &lt;Bundle-SymbolicName&gt;${project.artifactId}&lt;/Bundle-SymbolicName&gt;
  
                              &lt;Import-Package&gt;
                                  org.cal.api.*;version=1.0.0,
                                  org.osgi.*;,org.eclipse.osgi.framework.*;
                                 org.osgi.service.component.*;
  
                              &lt;/Import-Package&gt;
  
  
  
  
                          &lt;/instructions&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
  
          &lt;/build&gt;
  
  
  
  
      &lt;/project&gt;
  </code></pre>
  
  <p>When I run this program in OSGI console the following error appears on the console:</p>
  
  <pre><code>45  ACTIVE      cala_1.0.0
  46  ACTIVE      cali_1.0.0
  52  INSTALLED   calb_1.0.0
  osgi&gt; stop 45 46 52
  osgi&gt; start 45 46 52
  gogo: BundleException: The bundle "calb_1.0.0 [52]" could not be resolved. Reason:     Missing Constraint: Import-Package: org.osgi.service.component; version="[1.2.0,2.0.0)"
  </code></pre>
  
  <p>What can be the reason for this?</p>