Configure Driver Visibility using Mule Maven Plugin
Although Anypoint Studio enables you to configure database driver dependencies without problems in most cases, there are some scenarios where you must use the Mule Maven Plugin to properly set up the driver classes' visibility because of class loading isolation mechanisms.
To configure additional database driver dependencies and make the driver visible across components within your Mule application, refer to the Configure Shared Libraries section in the Mule Maven Plugin documentation.
When there is a risk of dependencies colliding and it’s necessary to have the Database Connector and the driver’s dependencies in the same class loader, to make the driver visible only for the connector, refer to the Configure Additional Plugin Dependencies section in the Mule Maven Plugin documentation.
|Be aware of which component must establish the connection with the database, as the driver must be in the scope of that component’s class loader. For example, if a Mule application uses a datasource reference connection and targets a Spring bean datasource definition, it is the Spring’s class loader that requires the database library, not the database. Configure additional application dependencies using shared libraries.|