Unable to load External Lib jar in the global config Mule SDK

143 Views Asked by At

I'm creating a CosmosDB connector using Mule SDK. I'm trying to add CosmosDB dependency in the global configuration using the below code but it seems to be not functioning as expected. It's downloading maven dependency but not adding the jar in the config. Please let me know what am I missing.

@ExternalLib(
  name = "Azure CosmosDB Driver",
  description = "Azure Cosmos DB driver that supports connection to the MySQL Database",
  requiredClassName = "com.azure.data.cosmos",
  type = ExternalLibraryType.JAR,
  coordinates="com.microsoft.azure:azure-cosmos:3.7.3"
)
public class AzureCosmosDBConnectionProvider implements ConnectionProvider<AzureCosmosDBConnection>

Please look at the below image: Here I provided all the details but when I click on Azure Cosmos DB Driver and add a dependency or JAR file. It's still throwing the same Error.

CosmosDB Mule global config

Thank you.

1

There are 1 best solutions below

6
aled On

It seems that the @ExternalLib annotation declares the library, but it doesn't include it in the module. You have to do that in the pom of the application, by adding it as a dependency, and add it as a shared library. That's what the Database connector does with the JDBC driver.