Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8548101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:25:00+00:00 2026-06-11T13:25:00+00:00

Problem I’m having a problem instantiating my OSGi bundle activator in the Felix OSGi

  • 0

Problem

I’m having a problem instantiating my OSGi bundle activator in the Felix OSGi container. When I attempt to start the bundle I get an error that I can’t cast the activator type to org.osgi.framework.BundleActivator despite the fact this is what the parent class is defined as in the project.

I’ve included org.osgi:org.osgi.core:5.0.0 in the activated bundles so that the class that has the activator can be STARTED. Should I need to reference the OSGi library in the OSGi bundle or should the Felix container provide them for me?

I have the same problem whether running Felix embedded or from the command line.

** Solution **

It turns out the version of OSGi in Felix is older than the latest standards. As I’m new to OSGi I just grabbed all of the latest things and started developing. I’ve moved back from version 5.0.0 to 4.3.0. The only difference I notice is the lack of nice generics in the API.

Now that my classes are compatible they can be resolved when started in the container. Previous problems were just due to the version of the library.

Background

I have a Maven built project that wasn’t starting because it couldn’t find dependencies to org.osgi.framework(vesrion>=1.7.0)(!(version>=2.0.0)).

The project configuraiton is

Main
  SubProjectApi
  SubProjectImpl
  SubProjectIntegrationTest

Where SubProjectImpl has a dependency to SubProjectApi. SubProjectApi has a bundle built using the maven-bundle-plugin but doesn’t contain any OSGi reference. SubProjectImpl references the Api module and provides a BundleActivator. To resolve the OSGi classes the project has a dependency to org.osgi:org.osgi.core:5.0.0. Everything compiles fine.

The project SubProjectIntegrationTest provides a set of unit tests to ensure the SubProjectImpl works properly within an embedded Felix environment. I’ve followed the guide for setting up the Felix instance (creating Activators, referencing the required Jars, etc.). Because the testing environment and the OSGi both need the same API classes I’ve used the org.osgi.framework.system.packages.extra configuration option to share the API classes.

When the test was started the following error was produced

ERROR: Bundle dsto.lod.simr.core [12] 
    Error starting file:target/SubProjectImpl.jar 
    (org.osgi.framework.BundleException: Unresolved constraint in bundle
    project.impl [12]: Unable to resolve 12.0: 
    missing requirement [12.0] osgi.wiring.package; 
    (&(osgi.wiring.package=org.osgi.framework)(version>=1.7.0)(!(version>=2.0.0))))

I thought the Felix environment would automatically provide those classes. I added the org.osgi.core module into the environment the problem changed to the one I have with casting types.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:25:02+00:00Added an answer on June 11, 2026 at 1:25 pm

    You should not install the Core API bundle. Those packages are exported by the framework implementation. If you install the bundle and resolve against the bundle, then your bundle and the framework implement will be using different Class objects for these classes.

    You also need to compile against a version of the core API whose version is less than or equal to the version supported by the framework implementation. It looks like you compiled against core 5.0 while the framework implementation is for core 4.3 (or some other version below 5.0).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I need to get a random element for a container and also delete
Problem : There are searches that can be stored in the DB. Each search
Problem: Been struggling to get my code to load external shaders and it is
Problem: I have a table that prints out vertical but I would like it
Problem occured when i tried to display xml data that has been taken by
Problem: I can set the exposureMode property of AVCaptureDevice, but it does not stay
Problem: I'm working on a website where there is a dial that displays a
Problem: I have 2 classes, DB class and a User class, that will work
Problem Description: Multi-player Game that works over the some kind of network, in game
Problem background: I have a Qt/QML Symbian application targeting Qt 4.7.4, that requires a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.