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 8571577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:48:44+00:00 2026-06-11T18:48:44+00:00

I am using two OSGi frameworks within a plain Java application. Both frameworks load

  • 0

I am using two OSGi frameworks within a plain Java application. Both frameworks load bundles from a shared directory.

In one bundle, I load a file from the resources. I tried different ways e.g.

this.getClass().getClassLoader().getResourceAsStream(...)
FrameworkUtil.getBundle(XXX.class).getEntry(...)
FrameworkUtil.getBundle(XXX.class).getResource(...)

But it doesn’t matter which of the commands I use, it all works fine at the beginning. However, after several install and uninstall steps in both frameworks. The returned InputStream is null.

I also works fine if use just one OSGi framework.

After debugging a little, I found that the Bundle a got with

FrameworkUtil.getBundle(XXX.class)

is pointing to the correct jar-file BUT when I look for the referenced bundlefile in the BundleData of the Bundle, it references the bundlefile of another bundle. The bundlefiles are temporary files of the OSGi framework (Equinox in my case), that can be found for example in the local Maven repository:

.m2\repository\org\eclipse\osgi\org.eclipse.osgi\3.6.0.v20100517\configuration\org.eclipse.osgi\bundles\29\1

Anyone has an idea what could be wrong here?

  • 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-11T18:48:45+00:00Added an answer on June 11, 2026 at 6:48 pm

    Both frameworks use the same directory to save the configurations of the bundles. It seems by accident one framework overwrites the bundlefile/configuration file of the other framework.

    When the bundle tries to access its resources it looks up the configuration file. If this file has been overwriten, the entry for the resource file is not available anymore, leading to an InputStream with value null.

    To avoid these kind of problems, it is possible to set the configuration directoy for each framework differently, e.g by

    Map<String, String> frameworkPropertiesMap = new HashMap<String, String>();
    frameworkPropertiesMap.put("osgi.configuration.area", "@user.home/osgi-framework-configuration-" + numberOfFramework);
    framework = getFrameworkFactory().newFramework(frameworkPropertiesMap);
    framework.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using two shared hosting companies, I want to install thebuggenie in one
I'm building an OSGi-based web application consisting of just two bundles for now. In
I am using two jQuery scripts. One is for controlling the drop down navigation
I am using two different scripts on one page and when I call them
I'm using two different TapGestureRecognizer to handle both single and double tap on screen.
I am using two different perspectives in Eclipse PyDev. One is for normal development,
Using two barcode readers connected to one machine, I have a need to store
Using two ScriptManagers(ASP.Net and Telerik) will effect the page performance ? I have both
I am currently using two XBees, one of them attached to my computer, and
I'm using two custom controls. One gathers the criteria for a search, and the

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.