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

  • SEARCH
  • Home
  • 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 325373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:12:39+00:00 2026-05-12T09:12:39+00:00

im having a ClassLoader issue. Since im quite an osgi newby, hopefully the answer

  • 0

im having a ClassLoader issue.
Since im quite an osgi newby, hopefully the answer isn’t that hard 🙂

I think it has to do with Compile vs. Runtime libraries.
in Netbeans 6.7.1 project properties, the compiletime libs are always propagated to the other categories.. so i can’t differentiate there.

When compiling the FelixHost the next jars are used

  • Felix.jar
  • osgi-core.jar
  • osgi-compendium.jar
  • osgi.service.obr-1.0.2.jar

But when running, the framework will load an implementation for OBR.
This OBR bundle also contains the interface definitions. I think this is why there’s a classCastException..

i actually want the FelixHost to work together with OBR to do some initial
provisioning..

Any ideas are welcome.

  • 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-05-12T09:12:39+00:00Added an answer on May 12, 2026 at 9:12 am

    I assume that by “FelixHost” you are referring to your project that is encapsulating and launching the Felix framework.

    The problem is that you have to be a bit careful about the boundary between “OSGi world” and “non-OSGi world”. Everything that you put on the classpath for FelixHost (i.e. also all compile time dependencies in your case) is essentially living outside of the OSGi world, so it’s not advisable to use bundles like “osgi.service.obr-1.0.2.jar” in this way.

    As you pointed out if the OSGi framework also loads the “osgi.service.obr-1.0.2.jar” bundle you will get into ClassCastException because you have essentially two versions of the same classes (interfaces).

    One possible solution to this problem is to separate your initial provisioning logic into a separate bundle and do the OBR related work from within the OSGi world. Then you can remove the compile dependency of FelixHost on “osgi.service.obr-1.0.2.jar” and only have one copy of OBR interfaces loaded.

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

Sidebar

Related Questions

why tomcat has its own classloader. what is the advantage of having user defined
Having been a PHP developer on LAMP servers for quite a while, is there
I'm having an issue when calling 32 bit Delphi DLL files from a C#
I'm having trouble when one of the jars that my web app depends on
I'm having some hard time with Java classloaders, maybe somebody could shed some light
I'm having a hard time figuring out where the problem is coming from, so
Im quite annoyed at having to ask this but I cant get it to
I'm having an issue executing jruby from the mingw git bash shell in windows.
Trying to set up a new spring project and im having this issue where
We are having classloading issues and we want to trace the JVM classloader. On

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.