Upgrade Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector) from version 1.x to version 2.x.
Changes
2.0
-
This connector is now compatible with Java 17 only.
-
Java classes moved from
org.mule.extension.mulechaintocom.mulesoft.connectors.mulechain. Update custom Java code that imports the previous package. -
com.mulesoft.connectors.mulechain.internal.config.LangchainLLMConfiguration.getModel()now returnsdev.langchain4j.model.chat.ChatModel. In version 1.x,org.mule.extension.mulechain.internal.config.LangchainLLMConfiguration.getModel()returneddev.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 withMS-AICHAIN:FILE_HANDLING_FAILURE. -
The connector excludes
log4j-apifrom the Apache Tika document parser and frommule-metadata-model-xml. Logging uses the SLF4J API. -
These libraries are upgraded to address reported security vulnerabilities:
-
The
bcprov-jdk18on,bcpkix-jdk18on,bcutil-jdk18on, andbcjmail-jdk18onlibraries are upgraded to version 1.86. -
The
netty-codec,netty-codec-http,netty-codec-http2, andnetty-codec-http3libraries are upgraded to version 4.2.18.Final. -
The
opennlp-toolslibrary is upgraded to version 2.5.12. -
The Jsoup library is upgraded to version 1.23.2.
-
The
jackson-databindandjackson-corelibraries 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-stdliblibrary is upgraded to version 2.4.20.
-
Requirements
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 |
Upgrade Prerequisites
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 tocom.mulesoft.connectors.mulechain. -
If your custom Java code calls
getModel(), update it for thecom.mulesoft.connectors.mulechain.internal.config.LangchainLLMConfigurationclass and thedev.langchain4j.model.chat.ChatModelreturn type. -
Remove
..from configuration and scanned-document file paths.
Upgrade Steps
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 chainin the search field. -
In the Available modules section, select MuleSoft AI Chain Connector and click Add.
-
Click Finish.
-
Verify that the
mule4-aichain-connectordependency version is2.x.xin thepom.xmlfile, wherex.xis the minor release and patch version number. For example, if you are upgrading to v2.0, the dependency version in thepom.xmlfile should be2.0.0.
Studio upgrades the connector automatically.
Verify the Upgrade
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.xmlfile and verify that there are no problems. -
Test the connection and verify that the operations work.
Troubleshooting
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.