wso2recompile

How to patch and recompile axis2_1.6.1.wso2v14.jar in wso2esb 4.9.0


If I modify manually axis2_1.6.1.wso2v14.jar, wso2esb 4.9.0 crashes at startup with the following message:

Could not start: null(reference:file:../plugins/axis2_1.6.1.wso2v14.jar:17). It's state is uninstalled.

In my case, I want to apply the following patch : https://github.com/wso2/wso2-axis2/commit/0f826cbf230b8c855b041ea1db3a751319cd3e91 that was released for wso2esb 5.0.0

Note: This happens even if I only unzip the jar, and then recreate it as it with

$ jar cf *

How can I patch and recompile axis2_1.6.1.wso2v14.jar in wso2esb 4.9.0 ?


Solution

  • You can basically follow the below steps. But before that check if the same fix was issued using a WUM update. If not

    1. You need to download the relevant tag first v1.6.1-wso2v14
    2. Cherry-pick the commit that you wanna include. (This may be straightforward in some cases, but there might be issues in some scenarios since there can be a lot of changes or dependency classes been changed. So be careful on that)
    3. Build the tag with the fix
    4. Get the build axis2_1.6.1-wso2v14.jar
    5. Create a new patch directory with a higher number inside <ESB-Home>/repository/component/patches directory
    6. Copy the jar file to that directory e.g. patch1000/axis2_1.6.1-wso2v14.jar (Check the jar file name, it should be same as in plugins directory)
    7. Restart the server

    You can refer to Doc1, Doc2 for more info

    Edited Don't try to package it using jar cf command. Run mvn clean install. This is not a standard jar but an OSGi bundle. So copy the jar file you get from mvn clean install. If the name differs just rename the jar name (- to _)