Search code examples
javajarupgradeapache-servicemix

Procedure to upgrade libraries on ServiceMix


What is the procedure to upgrade libraries on ServiceMix container (FuseESB compilation)?

I'm using Fuse version 4.4.1, which is using Spring 3.0.5. The newer version of Spring is available, so, when I would like to use it, what should I do?

With those directly referred in startup.properties the task is obvious, but what with the others, such as Spring? I was searching for update procedure description in Google, but with no effort. Have you done such update manually and could write what needed to be done except copying new jars?

Spring resides in system/org/springframework directory. Could I simply go to that directory and replace the Spring jar to the newer versions?

ServiceMix isn't well documented and I haven't found informations about such procedure.


Solution

  • The Fuse ESB v4.x stack is an OSGi container with Karaf as its Kernel. It could be as simple as creating an application specific feature XML that you have built up based on project dependencies avoiding the predefined features included with the ESB.

    One area where you may run into an issue is trying to add a newer version of a "core" (those defined in the startup.properties file) ESB runtime dependency, which should be completely acceptable in an OSGi container. Older versions of those bundles though had poorly defined manifests with imports that would only specify a version inclusion and not the exclusion. The OSGi container will then look at all the available packages that match an bundles defined import package and version and those that do not have the exclusion will get the highest available version at initialization of the bundle.

    For example, if there is a core bundle with a hard dependency on Spring Beans 2.5.6, but said bundle only specified version=2 and not version=[2,3), said core bundle would get the packages from the Spring Beans 3 bundle and not the Spring Beans 2.5.6 bundle potentially breaking the core bundle.

    Worse yet, there are times where some packages may match from the 2.5.6 bundle and not the Spring 3 bundle and you will get a cross inclusion that just basically blows up. Yes, I have seen this.

    Basically, you have to go at it with trial and error. Given all the possible permutations that are available to you with the Fuse ESB, depending on what features are loaded at runtime, it is impossible to have a cookbook that would define exactly the steps necessary to upgrade the container.