pvillard31 opened a new pull request, #10039: URL: https://github.com/apache/nifi/pull/10039
# Summary [NIFI-14682](https://issues.apache.org/jira/browse/NIFI-14682) - Help user with JDBC Driver configuration in DBCP controller service The goal is to improve the `verify` method in the `Abstract` class as well as the error handling in the `getDriver` method of the controller service implementation. We cannot use a `customValidate` approach as we may be in situation where one of those situations happen: - specified resources are not loaded in the classpath - some specified resources are using the URL approach and we may not have the resource locally available at the time - we may have some weirdly packaged JARs with very custom Drivers Given the above, we don't want to take the risk of making the component invalid and unusable. Instead we improve things in two places: - the `verify()` method but we cannot expect all of the specified resources to be loaded in the classpath at the time the method is called so the best approach is to have a static analysis of whatever is available to us and provide a non exhaustive list of what drivers can be used. - the `getDriver()` method - in this case, resources are loaded in the classpath so we can also verify that the classes that we suspect are potential drivers could indeed be loaded as drivers. The changes have been tested with many drivers, specified in different ways (asset, directory, file, URL) with many different vendors (H2, Derby, MS SQL, Postgres, ClickHouse, Snowflake). While this does not cover all possible scenarios of how the component has been configured, it does provide a more helpful error message in most cases when the specified driver class is not correct. # Tracking Please complete the following tracking steps prior to pull request creation. ### Issue Tracking - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created ### Pull Request Tracking - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000` - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000` ### Pull Request Formatting - [ ] Pull Request based on current revision of the `main` branch - [ ] Pull Request refers to a feature branch with one commit containing changes # Verification Please indicate the verification steps performed prior to pull request creation. ### Build - [ ] Build completed using `mvn clean install -P contrib-check` - [ ] JDK 21 ### Licensing - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html) - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files ### Documentation - [ ] Documentation formatting appears as expected in rendered files -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
