title: Unresolved constraint in bundle, missing requirement osgi.wiring.package
body: <p>I am having a project using OSGi-(felix), SpringDM, hibernate, maven. when I installed bundle, it is ok, the output when I run <i>bundle id</i> is:</p>
  
  <pre><code>LastModified         1384619994484
  Headers              [Manifest-Version=1.0, Bundle-Vendor=NguyenVinhLinh, Bnd-LastModified=1384619954778, Tool=Bnd-2.1.0.20130426-122213, Bundle-Name=DrugManager, Built-By=nguyenvinhlinh, Import-Package=org.hibernate,org.hibernate.classic,org.hibernate.criterion,org.springframework.beans.factory;version="[2.5,3)",org.springframework.core.io;version="[2.5,3)",org.springframework.transaction.annotation;version="[2.5,3)", Bundle-SymbolicName=DrugManagerDAO, Export-Package=drug,drugGroup,model;version="1.0.0", Bundle-Version=1.0.0, Build-Jdk=1.7.0_45, Created-By=Apache Maven Bundle Plugin, Bundle-ManifestVersion=2]
  BundleContext        null
  Revisions            [169.0]
  BundleId             169
  SymbolicName         DrugManagerDAO
  RegisteredServices   null
  ServicesInUse        null
  Version              1.0.0
  Location             file:/home/nguyenvinhlinh/Projects/felix-framework-4.2.1/bundle/DrugManager-1.0.jar
  State                2
  Bundle                 169|Installed  |    1|DrugManagerDAO (1.0.0)
  </code></pre>
  
  <p>This is what I see, when I start this bundle:</p>
  
  <pre><code>org.osgi.framework.BundleException: Unresolved constraint in bundle DrugManagerDAO [169]: Unable to resolve 169.0: missing requirement [169.0] osgi.wiring.package; (osgi.wiring.package=org.hibernate)
  </code></pre>
  
  <p>This is my beans.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:osgi="http://www.springframework.org/schema/osgi"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
     http://www.springframework.org/schema/osgi
     "&gt;
  
      &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt;
  
      &lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
          &lt;property name="mappingDirectoryLocations" ref="mappingProvider"/&gt;
          &lt;property name="hibernateProperties" ref="propertiesProvider"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/WOLOLO"/&gt;
  
          &lt;property name="username" value="root"/&gt;
          &lt;property name="password" value="123456"/&gt;
      &lt;/bean&gt;
      &lt;bean id="mappingProvider" class="hibernate.config.HibernateMappingProvider"/&gt;
      &lt;bean id="propertiesProvider" class="hibernate.config.HibernatePropertiesProvider"/&gt;
  
      &lt;bean id="drugDao" class="drug.HibernateDrugDao"&gt;
          &lt;property name="clazz" value="model.Drug"/&gt;
          &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
      &lt;/bean&gt;
       &lt;bean id="drugGroupDao" class="drugGroup.HibernateDrugGroupDao"&gt;
          &lt;property name="clazz" value="model.DrugGroup"/&gt;
          &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
      &lt;/bean&gt;
  
      &lt;osgi:service ref="drugDao" interface="drug.DrugDao"/&gt;
      &lt;osgi:service ref="drugGroupDao" interface="drugGroup.DrugGroupDao"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>This is my pom file:</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"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;DrugManager&lt;/groupId&gt;
      &lt;artifactId&gt;DrugManager&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;packaging&gt;bundle&lt;/packaging&gt;
  
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.osgi&lt;/groupId&gt;
              &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
              &lt;version&gt;4.3.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;hsqldb&lt;/groupId&gt;
              &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
              &lt;version&gt;1.8.0.10&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring&lt;/artifactId&gt;
              &lt;version&gt;2.5.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;20030825.184428&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-pool&lt;/groupId&gt;
              &lt;artifactId&gt;commons-pool&lt;/artifactId&gt;
              &lt;version&gt;20030825.183949&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate&lt;/artifactId&gt;
              &lt;version&gt;3.2.6.ga&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.27&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.0.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                  &lt;/configuration&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.4.0&lt;/version&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;configuration&gt;
                      &lt;instructions&gt;
                          &lt;Bundle-SymbolicName&gt;DrugManagerDAO&lt;/Bundle-SymbolicName&gt;
                          &lt;Bundle-Vendor&gt;NguyenVinhLinh&lt;/Bundle-Vendor&gt;
                          &lt;Export-Package&gt;"drug,drugGroup,model"&lt;/Export-Package&gt;
                          &lt;Import-Package&gt;org.hibernate&lt;/Import-Package&gt; &lt;!-- this line I try to insert into to fix requirement, but it does'nt work--&gt;
                      &lt;/instructions&gt;
                  &lt;/configuration&gt;
  
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;java.net&lt;/id&gt;
              &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>In addition, there is an completed error of bundle in felix.</p>
  
  <pre><code>g! ERROR: Bundle DrugManagerDAO [190] Error starting file:DrugManager-1.0.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle DrugManagerDAO [190]: Unable to resolve 190.0: missing requirement [190.0] osgi.wiring.package; (osgi.wiring.package=org.hibernate))
  org.osgi.framework.BundleException: Unresolved constraint in bundle DrugManagerDAO [190]: Unable to resolve 190.0: missing requirement [190.0] osgi.wiring.package; (osgi.wiring.package=org.hibernate)
      at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)
      at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
      at java.lang.Thread.run(Thread.java:744)
  </code></pre>