1

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 ?

jonenst
  • 339
  • 2
  • 11

1 Answers1

1

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 _)

Community
  • 1
  • 1
  • I tried the following and it didn't work: git checkout v1.6.1-wso2v14 apply patch to source mvn compile unzip previous axis2_1.6.1.wso2v14.jar replace the single modified class file jar cf * axis2_1.6.1.wso2v14.jar mkdir wso2esb/repository/components/patches/patch1000 cp axis2_1.6.1.wso2v14.jar wso2esb/repository/components/patches/patch1000 bin/wso2server.sh – jonenst Jul 25 '18 at 09:23
  • got the following error [2018-07-25 11:22:46,814] INFO {org.wso2.carbon.server.extensions.PatchInstaller} - Patch changes detected [2018-07-25 11:22:47,115] INFO {org.wso2.carbon.server.util.PatchUtils.console} - Backed up plugins to patch0000 [2018-07-25 11:22:47,162] INFO {org.wso2.carbon.server.util.PatchUtils.console} - Patch verification started [2018-07-25 11:22:47,211] INFO {org.wso2.carbon.server.util.PatchUtils.console} - Patch verification successfully completed. Could not start: null(reference:file:../plugins/axis2_1.6.1.wso2v14.jar:17). It's state is uninstalled. – jonenst Jul 25 '18 at 09:29
  • I did the unzip and rezip operation because when I run mvn package on the source, I get a jar with classes missing. The jar name is also somewhat different: axis2-1.6.1-wso2v14.jar (patched) vs axis2_1.6.1.wso2v14.jar (originally shipped by wso2 4.9.0) – jonenst Jul 25 '18 at 09:44
  • But the classes inside the jars are totally different. The distributed jar from the release doesn't seem to have been build with mvn clean install on the https://github.com/wso2/wso2-axis2/tree/v1.6.1-wso2v14 tag – jonenst Jul 30 '18 at 10:04
  • 1
    You need to get the built jar file from https://github.com/wso2/wso2-axis2/tree/v1.6.1-wso2v14/orbit/axis2 directory :) – Thusitha Thilina Dayaratne Jul 30 '18 at 23:38