You are experiencing the following issue on Mule 4 when you are try to deploy an application that has a DB connector using a 3rd Party Library. The example below is using the DB connector and the Oracle JDBC driver
ERROR 2018-09-20 12:31:87,235 [WrapperListener_start_runner] org.mule.runtime.core.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Testing connectivity for config 'Oracle_Database'.
Error trying to load driver: oracle.jdbc.driver.OracleDriver : Cannot load class 'oracle.jdbc.driver.OracleDriver': [
oracle.jdbc.driver.OracleDriver,
Cannot load class 'oracle.jdbc.driver.OracleDriver': [
Class 'oracle.jdbc.driver.OracleDriver' has no package mapping for region 'domain/default/app/Untitled'.,
Cannot load class 'oracle.jdbc.driver.OracleDriver': [
oracle.jdbc.driver.OracleDriver,
Class 'oracle.jdbc.driver.OracleDriver' not found in classloader for artifact 'container'.]]]
Type: class java.sql.SQLException
Within your pom.xml within Studio, you have added the the following entry.
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.3</version> </dependency>
Which works fine within Studio 7, but not when you deploy to a Mule Runtime.
The driver is required by more than one component therefore it is necessary to add this as a shared library within the pom.xml
The solution is to alter the configuration section of the pom.xml to include the following entry
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>myapp</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
<name>myapp</name>
<properties>
<... some properties />
</properties>
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<sharedLibraries>
<sharedLibrary>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
</sharedLibrary>
</sharedLibraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<... some other dependancies />
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
</dependencies>
<repositories>
<repository>
<... details/>
<repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<... details/>
</pluginRepository>
</pluginRepositories>
</project>
001117951

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.