Tuesday, April 16, 2013

What happens inside - When applying a patch on WSO2 kernal

To apply the patches first we need to do our changes in code base and generate jar files  corresponding to those changes by building the source. Then create directory with the name of the patch (ex: patch001) inside repository/components/patches directory and copy the generated jar files to the patch folder we previously created or copy the required patch files you need to apply

Run wso2server.sh -DapplyPatches,


First this will create a backup folder named patch0000 inside repository/components/patches directory containing the original content of repository/components/plugins folder. This step is conduct to support revert-back to the previous state if something get wrong during the operations. Next the content of the patches directory will incrementally (ex: patch0001, patch0002, etc.. ) get copied to the plugins directory.


WSO2 Carbon is implemented using OSGi bundles, so if we need to extend the platform it can be done by dropping OSGi bundles on directories provided. There are different directory locations that user can apply different patches and jars which need to be applied. The OSGi repository of WSO2 Carbon is located on  $CARBON_HOME/repository/components directory. $CARBON_HOME is the generated folder when we extracted an Carbon or Carbon based product. The following directories can be used to drop the external libraries to the Carbon server. After adding the required libraries the server need to be restarted to apply the changes.

  • $CARBON_HOME/repository/components/patches

The patches inside this directory will be applied automatically when running "wso2server.sh -DapplyPatches" command and these patches will be coppied to plugins directory. This only support for plugin components.

Components other than plugins, user need to manually insert the corresponding entries to the bundles.info file at,
$CARBON_HOME/repository/components/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info

  • $CARBON_HOME/repository/components/dropins

This directory can be used to drop other OSGi bundles which need to be applied.
  • $CARBON_HOME/repository/components/lib

This directory contain dropped jar files and during startup these jars will be converted to OSGi bundles and then will be copied to dropins directory.
  • $CARBON_HOME/repository/components/extensions

This directory also contain dropped jar files and during startup these jars will be converted to OSGi framework Extension bundles and will be copied to dropins directory.

Referance,




No comments:

Post a Comment