davidzollo commented on issue #9495:
URL: https://github.com/apache/seatunnel/issues/9495#issuecomment-3795708600

   This issue is caused by multiple instances of the `debezium-core` library on 
the classpath:
   1. One transitively brought in by `debezium-connector-mysql`.
   2. Another provided by `connector-cdc-base` (which relies on 
`debezium-core`).
   
   This results in the `TableId` class being loaded by different class loaders 
or from different JAR versions, leading to a `ClassCastException`.
   
   ## Solution
   Modified `seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/pom.xml` 
to exclude `debezium-core` and `debezium-api` from the 
`debezium-connector-mysql` dependency. This ensures the project consistently 
uses the Debezium core classes provided by `connector-cdc-base`.
   
   ### Changes Applied to `pom.xml`
   
   ```xml
           <dependency>
               <groupId>io.debezium</groupId>
               <artifactId>debezium-connector-mysql</artifactId>
               <exclusions>
                   <exclusion>
                       <groupId>mysql</groupId>
                       <artifactId>mysql-connector-java</artifactId>
                   </exclusion>
                   <!-- Added exclusions to prevent ClassCastException -->
                   <exclusion>
                       <groupId>io.debezium</groupId>
                       <artifactId>debezium-core</artifactId>
                   </exclusion>
                   <exclusion>
                       <groupId>io.debezium</groupId>
                       <artifactId>debezium-api</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
   ```
   
   ## Verification
   After applying this fix, reload the Maven project to update dependencies. 
The `SeaTunnelEngineLocalExample` should now run without the 
`ClassCastException`.


-- 
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]

Reply via email to