0 votes
asked in MicroStream for Java by (160 points)
Hi there,

first of all: great product and thanks a lot for presenting it at the JUG Augsburg.

As I already suggested at the meeting: I t would be great if your libraries had proper OSGi Metadata in their Manifest files.

As I couldn't wait to try it out in our setup I already repackaged your "all" jar and made a testdrive with it within an OSGi Environment. At least your hello world application works like a charm :)

All you would need to do is to add either the bnd maven/gradle plugin or the apache-felix maven-bundle-plugin to your build and it will generate all the needed OSGi Metadata for you. As long as you are not doing any nasty classloading/serviceloader stuff within your library, this would make microstream usable in every OSGi runtime.

If you need any support regarding OSGi I will gladly help you out.


Keep up your great work!


Kind regards.


1 Answer

0 votes
answered by (160 points)
edited by
First finding: Of course you are doing some sort of classloading internally (my bad, sorry ;) ) so your manifest file would need a Header like

DynamicImport-Package: *

in order to find the class files it needs in an OSGi environment.

Either this or I could use my own classloader.

I will further test it and if I find something, I will post my findings here :)
commented by (3.4k points)
Hello Thomas,

many thanks for your post and your offer to give us some support regarding OSGi.
We already created an internal issue to add proper OSGi support to Microstream. Unfortunately, I cannot estimate when it will be available.


Regarding the class loading:

Microstream needs access to all classes that have been stored to recreate the persisted objects. This is done on startup if an existing storage has been found or during lazy-loading. By default, Microstream uses the standard Java classloader but you can provide a custom class loader quit easily.
see https://manual.docs.microstream.one/data-store/customizing/custom-class-loader

please let us know If you have any suggestions or questions.


Best regards
commented by (160 points)

Hi Harald,

thanks for the link. This would indeed be a possibility to use microstream in OSGi. 

However, I think the simpler approach would be to add the above mentioned header to your manifest. At least for all my test this worked perfectly.


All I did was to repackage your "all" artifact and generate the manifest via maven-bundle-plugin.

Don't know if this helps you, but here is the needed maven plugin configuration for this:


The module's packaging would need to be "bundle" instead of jar, but there's virtually no difference between those two aside from the additional information in the manifest.


Kind regards,



Notes: Every question must be a separate forum post. Headline: Formulate your question shortly and precisely. Thank you!
Powered by Question2Answer