org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.osgi.extender; version="1.1.2" at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30)

Spring JIRA | Charles Moulliard | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    see : http://forum.springframework.org/showthread.php?t=64036 Hi, I have created a spring dynamic module - eclipse project using the following command : C:\demo>mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archet ype -DarchetypeVersion=1.1.2 -DgroupId=com.xpectis.demo -DartifactId=com.xpectis.demo.my-spring-bundle -Dversion=0.1 Within Eclipse, I have launched the command "mvn package" in order to create the manifest file and created a junit test class : package com.xpectis.demo; import org.osgi.framework.Bundle; import org.osgi.framework.Constants; import org.osgi.service.packageadmin.PackageAdmin; import org.springframework.osgi.test.AbstractConfigurable BundleCreatorTests; import org.springframework.osgi.util.OsgiStringUtils; public class OsgiTest extends AbstractConfigurableBundleCreatorTests { //private PackageAdmin pkgAdmin; public void testSimple() throws Exception { Bundle bnd = bundleContext.getBundle(); System.out.println(bundleContext.getProperty(Const ants.FRAMEWORK_VENDOR)); System.out.println(OsgiStringUtils.nullSafeName(bn d)); } } When I launch junit, I receive the following error : main DEBUG [com.xpectis.demo.OsgiTest] - Starting [SLF4J Jakarta Commons Logging Over SLF4J Binding (com.springsource.slf4j.org.apache.commons.logging )|file:/c:/.m2/repository/org/slf4j/com.springsource.slf4j.org.apache.commons.logging/1.5.0/com.springsource.slf4j.org.apache.commons.logging-1.5.0.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-aop (org.springframework.bundle.spring.aop)|file:/c:/.m2/repository/org/springframework/spring-aop/2.5.5/spring-aop-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-beans (org.springframework.bundle.spring.beans)|file:/c:/.m2/repository/org/springframework/spring-beans/2.5.5/spring-beans-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-context (org.springframework.bundle.spring.context)|file:/c:/.m2/repository/org/springframework/spring-context/2.5.5/spring-context-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-core (org.springframework.bundle.spring.core)|file:/c:/.m2/repository/org/springframework/spring-core/2.5.5/spring-core-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-test (org.springframework.bundle.spring.test)|file:/c:/.m2/repository/org/springframework/spring-test/2.5.5/spring-test-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [log4j.osgi (org.springframework.osgi.log4j.osgi)|file:/c:/.m2/repository/org/springframework/osgi/log4j.osgi/1.2.15-SNAPSHOT/log4j.osgi-1.2.15-SNAPSHOT.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-osgi-annotation (org.springframework.bundle.osgi.extensions.annota tions)|file:/c:/.m2/repository/org/springframework/osgi/spring-osgi-annotation/1.1.2/spring-osgi-annotation-1.1.2.jar] main ERROR [com.xpectis.demo.OsgiTest] - cannot start bundle [spring-osgi-annotation (org.springframework.bundle.osgi.extensions.annota tions)|file:/c:/.m2/repository/org/springframework/osgi/spring-osgi-annotation/1.1.2/spring-osgi-annotation-1.1.2.jar] org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.osgi.extender; version="1.1.2" at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit 3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196) main DEBUG [com.xpectis.demo.OsgiTest] - Caught exception starting up After verification, it appears that the "missing" jar is well present in my c:\.m2\repository\.... folder Where is the issue ?

    Spring JIRA | 8 years ago | Charles Moulliard
    org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.osgi.extender; version="1.1.2" at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30)
  2. 0

    see : http://forum.springframework.org/showthread.php?t=64036 Hi, I have created a spring dynamic module - eclipse project using the following command : C:\demo>mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archet ype -DarchetypeVersion=1.1.2 -DgroupId=com.xpectis.demo -DartifactId=com.xpectis.demo.my-spring-bundle -Dversion=0.1 Within Eclipse, I have launched the command "mvn package" in order to create the manifest file and created a junit test class : package com.xpectis.demo; import org.osgi.framework.Bundle; import org.osgi.framework.Constants; import org.osgi.service.packageadmin.PackageAdmin; import org.springframework.osgi.test.AbstractConfigurable BundleCreatorTests; import org.springframework.osgi.util.OsgiStringUtils; public class OsgiTest extends AbstractConfigurableBundleCreatorTests { //private PackageAdmin pkgAdmin; public void testSimple() throws Exception { Bundle bnd = bundleContext.getBundle(); System.out.println(bundleContext.getProperty(Const ants.FRAMEWORK_VENDOR)); System.out.println(OsgiStringUtils.nullSafeName(bn d)); } } When I launch junit, I receive the following error : main DEBUG [com.xpectis.demo.OsgiTest] - Starting [SLF4J Jakarta Commons Logging Over SLF4J Binding (com.springsource.slf4j.org.apache.commons.logging )|file:/c:/.m2/repository/org/slf4j/com.springsource.slf4j.org.apache.commons.logging/1.5.0/com.springsource.slf4j.org.apache.commons.logging-1.5.0.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-aop (org.springframework.bundle.spring.aop)|file:/c:/.m2/repository/org/springframework/spring-aop/2.5.5/spring-aop-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-beans (org.springframework.bundle.spring.beans)|file:/c:/.m2/repository/org/springframework/spring-beans/2.5.5/spring-beans-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-context (org.springframework.bundle.spring.context)|file:/c:/.m2/repository/org/springframework/spring-context/2.5.5/spring-context-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-core (org.springframework.bundle.spring.core)|file:/c:/.m2/repository/org/springframework/spring-core/2.5.5/spring-core-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-test (org.springframework.bundle.spring.test)|file:/c:/.m2/repository/org/springframework/spring-test/2.5.5/spring-test-2.5.5.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [log4j.osgi (org.springframework.osgi.log4j.osgi)|file:/c:/.m2/repository/org/springframework/osgi/log4j.osgi/1.2.15-SNAPSHOT/log4j.osgi-1.2.15-SNAPSHOT.jar] main DEBUG [com.xpectis.demo.OsgiTest] - Starting [spring-osgi-annotation (org.springframework.bundle.osgi.extensions.annota tions)|file:/c:/.m2/repository/org/springframework/osgi/spring-osgi-annotation/1.1.2/spring-osgi-annotation-1.1.2.jar] main ERROR [com.xpectis.demo.OsgiTest] - cannot start bundle [spring-osgi-annotation (org.springframework.bundle.osgi.extensions.annota tions)|file:/c:/.m2/repository/org/springframework/osgi/spring-osgi-annotation/1.1.2/spring-osgi-annotation-1.1.2.jar] org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.osgi.extender; version="1.1.2" at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit 3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196) main DEBUG [com.xpectis.demo.OsgiTest] - Caught exception starting up After verification, it appears that the "missing" jar is well present in my c:\.m2\repository\.... folder Where is the issue ?

    Spring JIRA | 8 years ago | Charles Moulliard
    org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.osgi.extender; version="1.1.2" at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30)
  3. 0

    Bundle could not be resolved (Missing Constraint: Import-Package: org.springframework - Spring Forum

    spring.io | 9 months ago
    org.osgi.framework.BundleException: The bundle could not be resolved. at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.osgi.framework.BundleException

      The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.osgi.extender; version="1.1.2" at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:294) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.springframework.osgi.test.AbstractOsgiTests.st artBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult .java:124) at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:2 30)

      at junit.framework.TestSuite.run()
    2. JUnit
      TestSuite.run
      1. junit.framework.TestSuite.run(TestSuite.java:225)
      1 frame