Getting started Community Training Tutorials Documentation APIs, AI & Tools
1.x
Upgrade Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector) from version 1.x to version 2.x.
This connector is now compatible with Java 17 only.
Java classes moved from org.mule.extension.mulechain to com.mulesoft.connectors.mulechain. Update custom Java code that imports the previous package.
com.mulesoft.connectors.mulechain.internal.config.LangchainLLMConfiguration.getModel() now returns dev.langchain4j.model.chat.ChatModel. In version 1.x, org.mule.extension.mulechain.internal.config.LangchainLLMConfiguration.getModel() returned dev.langchain4j.model.chat.ChatLanguageModel.
You can use tools with Ollama chat models. The embedded LangChain4j engine is upgraded from 0.34.0 to 1.20.0. For more information, see Tools Use AI Service.
File paths that contain a .. segment are rejected. A Configuration Json File Path that contains .. is not loaded. The Image Read Scanned Documents File Path fails with MS-AICHAIN:FILE_HANDLING_FAILURE.
The connector excludes log4j-api from the Apache Tika document parser and from mule-metadata-model-xml. Logging uses the SLF4J API.
These libraries are upgraded to address reported security vulnerabilities:
The bcprov-jdk18on, bcpkix-jdk18on, bcutil-jdk18on, and bcjmail-jdk18on libraries are upgraded to version 1.86.
The netty-codec, netty-codec-http, netty-codec-http2, and netty-codec-http3 libraries are upgraded to version 4.2.18.Final.
The opennlp-tools library is upgraded to version 2.5.12.
The Jsoup library is upgraded to version 1.23.2.
The jackson-databind and jackson-core libraries are upgraded to version 2.22.3.
The Reactor Netty HTTP library is upgraded to version 1.3.7.
The Reactor Core library is upgraded to version 3.8.7.
The DJL API library is upgraded to version 0.38.0.
These libraries are upgraded:
The Google Guava library is upgraded to version 33.7.1-jre.
The Apache Mime4j Core library is upgraded to version 0.8.15.
The SLF4J API is upgraded to version 2.0.19.
The Junrar library is upgraded to version 8.1.1.
The Kotlin kotlin-stdlib library is upgraded to version 2.4.20.
Ensure your system meets the following compatibility requirements before you perform the upgrade:
| Application/Service | Version |
|---|---|
Mule runtime |
4.9.0 and later |
Java |
17 |
Before you perform the upgrade, you must:
Create a backup of your files, data, and configuration in case you need to restore to the previous version.
Ensure that your environment meets the version 2.x requirements, including Java 17 and Mule runtime 4.9.0 or later.
If your custom Java code imports org.mule.extension.mulechain, update it to com.mulesoft.connectors.mulechain.
If your custom Java code calls getModel(), update it for the com.mulesoft.connectors.mulechain.internal.config.LangchainLLMConfiguration class and the dev.langchain4j.model.chat.ChatModel return type.
Remove .. from configuration and scanned-document file paths.
Follow these steps to perform the upgrade from MuleSoft AI Chain Connector 1.x to MuleSoft AI Chain Connector 2.x:
In Anypoint Studio, create a Mule project.
In the Mule Palette view, click Search in Exchange.
In the Add Dependencies to Project window, enter mulesoft ai chain in the search field.
In the Available modules section, select MuleSoft AI Chain Connector and click Add.
Click Finish.
Verify that the mule4-aichain-connector dependency version is 2.x.x in the pom.xml file, where x.x is the minor release and patch version number. For example, if you are upgrading to v2.0, the dependency version in the pom.xml file should be 2.0.0.
Studio upgrades the connector automatically.
After you install the latest version of the connector, follow these steps to verify the upgrade:
In Studio, verify that there are no errors in the Problems or Console views.
Check the project pom.xml file and verify that there are no problems.
Test the connection and verify that the operations work.
If the app doesn’t start, confirm that it runs on Mule runtime 4.9.0 or later and on Java 17.
If custom Java code no longer compiles, update imports from org.mule.extension.mulechain to com.mulesoft.connectors.mulechain, and update getModel() to use the dev.langchain4j.model.chat.ChatModel return type.
If a Configuration Json file is not loaded, or Image Read Scanned Documents fails with MS-AICHAIN:FILE_HANDLING_FAILURE, remove .. from the file path.