bugfix: Resolve MySQL Driver Loading Issue (#6760) #6765
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
This PR resolves the issue of the MySQL driver not loading when starting the
apache/seata-server:2.1.0.jre17
Docker image. The fix involves removing the custom classloader setup and relying on the default classloader to handle the MySQL driver loading. Additionally, the MySQL driver jar has been moved from thelib/jdbc
directory to thelib
directory, simplifying the path and ensuring the driver is loaded properly.Ⅱ. Does this pull request fix one issue?
fixes #6760
Ⅲ. Why don't you add test cases (unit test/integration test)?
The changes made pertain to configuration and environment setup, which are typically validated through deployment tests rather than unit or integration tests. Future contributions could focus on creating automated tests for Docker image configurations to ensure environment consistency.
Ⅳ. Describe how to verify it
To verify this fix:
lib
directory.mvn clean install -P release-seata
to build the project.incubator-seata/distribution/target/apache-seata-x.x.x-incubating-bin/apache-seata/bin
and executeseata-server.sh
.application.yml
settings forseata.config.type: file
, and check the logs to verify that thestore.db.driverClassName = com.mysql.cj.jdbc.Driver
setting fromfile.conf
is correctly utilized.Ⅴ. Special notes for reviews
Please focus on the changes made to the classloader behavior and the repositioning of the MySQL driver jar. Confirm that these changes align with best practices for Docker and Java application deployments. Additionally, verify that the removal of custom classloader settings does not inadvertently affect other aspects of the system's behavior.