Search code examples
jsonmulemule-componentmulesoftmule-esb

How to exclude the org.json version in MULE 3.9.0 buildpath?


How to exclude the org.json version in MULE 3.9.0 buildpath? The version is json-20140107 I want to use the latest json version. I tried to exclude in mule-commons but it did not do any help.


Solution

  • The json-20140107.jar library is distributed with Mule 3.9.0. Because of how Mule implements classloading, at execution time classes loaded from that jar file will override a newer version in your application. You must not change the version provided because Mule was tested. Changing any provided library in the distribution can cause unexpected errors.

    You could pack a new version of the library and try to use Fine Grain Classloader Control however that seems to be an Enterprise Edition feature not available in the community edition. If you have the Enterprise Edition it is highly recommended to use the last patch version (currently 3.9.4) instead of 3.9.0.

    Another solution could be to migrate to Mule 4.x, which uses classloading isolation to avoid this kind of issues. You can use any version of libraries inside applications without conflicting with the provided libraries in the runtime. Again, using the last version available is the recommended way to go. Mule 3 applications are not compatible with Mule 4, so you will need to migrate existing applications.