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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:21:07+00:00 2026-06-02T02:21:07+00:00

I am developing a OSGi program composed of several bundles that I run sometimes

  • 0

I am developing a OSGi program composed of several bundles that I run sometimes on my local windows dev computer, sometimes on a classic linux.
Currently, several bundles dedicated to resource connection have their own configuration file (properties file) containing some informations like the path to access some important files (present on both environments).

However, since the paths are different on the two execution-environments, I have to manually change the configuration before compilation, depending on which environment I am going to run my program in.

Is there a way for bundles to refer to an external configuration file? A solution could be to create a fragment for each environment that I generate only once, but I won’t be able to change the configuration file easily since it will be in the jar of the fragment.

Are there some “best practices” that I should know to solve my “simple” problem ?

  • 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-02T02:21:09+00:00Added an answer on June 2, 2026 at 2:21 am

    Take a look at OSGi’s ConfigurationAdmin [1],[2] – this will suit your needs exactly (and is yet another example of OSGi’s elegance).

    Basically you’ll implement a ManagedService or ManagedServiceFactory and the ConfigurationAdmin service take care of the rest.

    The default setup for the Felix implementation used in concert with File Install (see Angelo’s comment) will scan a directory of configuration files (filename is the service ID and file suffix .cfg). But ConfigurationAdmin is pluggable, so the backend for config could be a database etc.

    The great thing about externalizing your config in this way is that you can keep it with the app/environment – so your bundles become agnostic of their environment.

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

Sidebar

Related Questions

I'm developing a web application that is going to be served from an OSGi
Developing search utility to search a file entire computer system, works fine on windows
Developing applications for Android in Eclipse, press F11 to run the program in the
I'm developing my application as a set of OSGi bundles using Maven 2. Some
Developing an application using SWT to work in both Linux and Windows. I created
I came upon the following obstacle whilst developing in OSGi. One set of bundles,
I am developing an application using OSGi (Equinox platform), and one of the bundles
When developing a .Net web application, if a run time error is generated, it
I´m developing a software in C# that uses static functions from a C++ .dll
Developing rails has become lots of fun over the year that I've done it,

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.