---
schema_version: "1"
id: ab45c78273fc027f33bf19c071d502497694d781acac2585dda4041b7ca1a6c4
title: Upgrading and Migrating MuleSoft AI Chain Connector to 2.x
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-upgrade-migrate.md
canonical_url: https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-upgrade-migrate
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4749e57791eea50a86e4c0ef85e0ed5917071f3b1f2315840069cf224ea0e6d5
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
---
product: MuleSoft AI Chain Connector
version: 2.0
is-latest-version: true
---

# Upgrading and Migrating MuleSoft AI Chain Connector to 2.x

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Upgrade Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector) from version 1.x to
version 2.x.

## Supported Upgrade Paths

<table><colgroup><col> <col></colgroup><thead><tr><th>From Version</th><th>To Version</th></tr></thead><tbody><tr><td><div><div><p>1.x</p></div></div></td><td><div><div><p>2.x</p></div></div></td></tr></tbody></table>

## Changes

### 2.0

- 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](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference#ToolsUseAiService).

- File paths that contain a `..` segment are rejected. A **Configuration Json**
  [File Path](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference#Config) that contains `..` is not loaded. The
  [Image Read Scanned Documents](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference#ImageReadScannedDocuments)
  **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.

## Requirements

Ensure your system meets the following compatibility requirements before you perform the upgrade:

<table><colgroup><col> <col></colgroup><thead><tr><th>Application/Service</th><th>Version</th></tr></thead><tbody><tr><td><p>Mule runtime</p></td><td><p>4.9.0 and later</p></td></tr><tr><td><p>Java</p></td><td><p>17</p></td></tr></tbody></table>

## Upgrade Prerequisites

Before you perform the upgrade, you must:

1.  Create a backup of your files, data, and configuration in case you need to restore to the
    previous version.

2.  Ensure that your environment meets the version 2.x requirements, including Java 17 and Mule
    runtime 4.9.0 or later.

3.  If your custom Java code imports `org.mule.extension.mulechain`, update it to
    `com.mulesoft.connectors.mulechain`.

4.  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.

5.  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:

1.  In Anypoint Studio, create a Mule project.

2.  In the Mule Palette view, click **Search in Exchange**.

3.  In the **Add Dependencies to Project** window, enter `mulesoft ai chain` in the search field.

4.  In the **Available modules** section, select **MuleSoft AI Chain Connector** and click **Add**.

5.  Click **Finish**.

6.  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.

## Verify the Upgrade

After you install the latest version of the connector, follow these steps to verify the upgrade:

1.  In Studio, verify that there are no errors in the **Problems** or **Console** views.

2.  Check the project `pom.xml` file and verify that there are no problems.

3.  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.

## Revert the Upgrade

If it is necessary to revert to the previous version of MuleSoft AI Chain Connector, change the
`mule4-aichain-connector` dependency version in the project’s `pom.xml` file to the previous
version.

You must update the project’s `pom.xml` file in Anypoint Studio.

## See Also

- [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/)

- [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference)

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
