cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <>
Subject Re: OSGI bundle, best practices
Date Fri, 23 Jun 2017 08:46:01 GMT
CXF-DOSGi provides a way to create cxf clients and endpoints from OSGi
services. It might be quite useful for the case you are describing.
You can also use CXF without DOSGi. CXF provides all jars as bundles.
Installing it is mainly installing the right bundles and tuning some few
system package exports.

There is no single bundle that provides all the functionality of CXF. We
had this in the past but it had lots of drawbacks. Especially as it defeats
the whole idea of modularity.

So the biggest challenges in using CXF in OSGi is how to install it
correctly. There are three ways to do this:
1. Use Apache karaf. We have CXF features for karaf that allow to install
CXF easily. This might not be an option for you short term as switching to
karaf would be a bigger task.
2. Use the multi bundle distro of CXF-DOSGi. In this distro there are the
bundles you need to install into your OSGi framework. This is quite error
prone though.
3. Use bndtools and the bnd resolver to build your system.

For 3 there is an example in the CXF-DOSGi code:
Basically you define the -runrequires as a set of top level bundles to
install and let the resolver figure out the dependencies.
This requires to have a repository of bundles to choose from. We provide
this for CXF-DOSGi here:

I am not sure if you can directly use variant 3 as it depends on how you
assembly your OSGi runtime at the moment.
At the very least though you can use the list of runbundles that you get
from the build and use it for your environment.

If you are not already doing so then you should adopt a method to assemble
your whole application that uses the OSGi resolver. It makes it easier to
choose the right bundle and gives you an early warning if your deployment
is incomplete or inconsistent.


2017-06-23 9:45 GMT+02:00 Raffaele Gambelli <>:

> Hi all,
> I would like to receive some hints about the correct management of CXF in
> a OSGI/Equinox environment.
> As premise I'm just arrived in a company where there is a big application
> deployed in OSGI, with many bundles, my colleagues have told me about many
> conflicts in using cxf in the different bundles, so they prefered not using
> it at all.
> For what I can see, there was a wrong usage of OSGI paradigm, for example,
> each bundle who makes use of cxf:
> - embed all cxf direct and transitive dependencies, so each bundle has all
> what it needs inside it, but bundles are big
> - that is, each bundle has <import-package>!*,</import-package>, that it
> is states that bundle does import nothing, because it embeds everything
> They use no cxf bundles at all, but there are a couple of bundles
> embedding it...
> I would like to know if exist a cxf bundle, I found this
> but I'm not  understanding
> really if it is useful in my scenario of if it is something too big to be
> simply placed in an already complex system like the our.
> Otherwise which best practice should we adopt? Does it make sens create
> our cxf bundle and modifying all the other bundles to import packages from
> it?
> Really thanks to all, OSGI seems very difficoult but we believe that it
> has many strengths
> Raffaele Gambelli

Christian Schneider

Open Source Architect

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message