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
  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 | 7 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

  5. 0

    Installing and setting up Eclipse with Sun's Java [Archive] - Ubuntu Forums

    ubuntuforums.org | 7 months ago
    org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid at org.eclipse.osgi.framework.internal.core.AbstractB undle.loadBundleActivator(AbstractBundle.java:141) at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(BundleContextImpl.java:962) at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(BundleHost.java:317) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(AbstractBundle.java:256) at org.eclipse.osgi.framework.util.SecureAction.start (SecureAction.java:342) at org.eclipse.core.runtime.internal.adaptor.EclipseL azyStarter.preFindLocalClass(EclipseLazyStarter.ja va:88) at org.eclipse.osgi.baseadaptor.loader.ClasspathManag er.findLocalClass(ClasspathManager.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.findLocalClass(DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoa der.findLocalClass(BundleLoader.java:334) at org.eclipse.osgi.framework.internal.core.SingleSou rcePackage.loadClass(SingleSourcePackage.java:37) at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:383) at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:347) at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51) at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
  6. 0

    Loader constraint violation in bundles with different versions - Spring Forum

    spring.io | 6 months ago
    org.osgi.framework.BundleException: Exception in osgi.solution.Activator.start() of bundle osgi.solution. at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.startActiv ator(BundleContextImpl.java:1018) at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.start(Bund leContextImpl.java:974) at org.eclipse.osgi.framework.internal.core.BundleHos t.startWorker(Bundl eHost.java:346) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(Abstrac tBundle.java:260) at org.eclipse.osgi.framework.internal.core.AbstractB undle.start(Abstrac tBundle.java:252) at org.eclipse.osgi.framework.internal.core.Framework CommandProvider._st art(FrameworkCommandProvider.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    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