pikachu011 opened a new issue, #4252:
URL: https://github.com/apache/streampark/issues/4252

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/streampark/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### Java Version
   
   jdk 1.8
   
   ### Scala Version
   
   2.12.x
   
   ### StreamPark Version
   
   2.1.5
   
   ### Flink Version
   
   flink 1.20.1
   
   ### Deploy mode
   
   None
   
   ### What happened
   
   I rely on Flink-table-planner_2.12 to get an error: Multiple factories for 
identifier 'default' that implement 
'org.apache.flink.table.delegation.ExecutorFactory' , If I don't rely on 
Flink-table-planner_2.12, another error will be reported: Provider 
org.apache.flink.table.planner.delegation.DefaultExecutorFactory not found, 
Trapped in a vicious cycle. Here are my dependencies:
   
   
   
   <?xml version="1.0" encoding="UTF-8"?>
   <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/xsd/maven-4.0.0.xsd";>
     <modelVersion>4.0.0</modelVersion>
   
     <groupId>org.example</groupId>
     <artifactId>stream-demo</artifactId>
     <version>1.0-SNAPSHOT</version>
   
   
     <properties>
       <flink.version>1.20.1</flink.version>
       <scala.binary.version>2.12</scala.binary.version>
       <doris.connector.version>1.20_2.12-1.4.0</doris.connector.version>
       <java.version>1.8</java.version>
     </properties>
   
     <dependencies>
       <!-- Flink核心依赖 -->
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-java</artifactId>
         <version>${flink.version}</version>
       </dependency>
   
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-clients</artifactId>
         <version>${flink.version}</version>
         <!-- 本地调试时移除 scope,生产环境可恢复为 provided -->
   <!--       <scope>provided</scope>-->
       </dependency>
   
   
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-connector-base</artifactId>
         <version>${flink.version}</version>
         <!-- 本地调试时移除 scope,生产环境可恢复为 provided -->
       </dependency>
   
   
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-streaming-java</artifactId>
         <version>${flink.version}</version>
       </dependency>
       <!-- Flink Table Common,用于 Catalog 等 -->
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-common</artifactId>
         <version>${flink.version}</version>
       </dependency>
       <!-- Table API -->
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-api-java</artifactId>
         <version>${flink.version}</version>
       </dependency>
   
   
       <!-- Doris连接器 -->
       <dependency>
         <groupId>org.apache.doris</groupId>
         <artifactId>flink-doris-connector-1.20</artifactId>
         <version>24.0.1</version>  <!-- 官方兼容版本 -->
         <exclusions>
           <!-- 排除传递冲突的Planner模块 -->
           <exclusion>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-table-planner_2.12</artifactId>
           </exclusion>
           <exclusion>
             <groupId>org.apache.flink</groupId>
             <artifactId>flink-table-planner-loader</artifactId>
           </exclusion>
           <!-- 排除冲突的Scala库 -->
           <exclusion>
             <groupId>org.scala-lang</groupId>
             <artifactId>*</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
   
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-api-java-bridge</artifactId>
         <version>${flink.version}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-planner_2.12</artifactId>
         <version>1.20.1</version>
       </dependency>
   
   
   
   
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-planner-loader</artifactId>
         <version>${flink.version}</version>
         <exclusions>
           <exclusion>
             <groupId>*</groupId>
             <artifactId>*</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
   
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-runtime</artifactId>
         <version>${flink.version}</version>
       </dependency>
       <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-json</artifactId> <!-- 解决JSON解析问题 -->
         <version>${flink.version}</version>
       </dependency>
   
   
       <!-- 日志 -->
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
         <version>1.7.36</version>
       </dependency>
     </dependencies>
   
     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>3.8.1</version>
           <configuration>
             <source>${java.version}</source>
             <target>${java.version}</target>
           </configuration>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-shade-plugin</artifactId>
           <version>3.3.0</version>
           <executions>
             <execution>
               <phase>package</phase>
               <goals><goal>shade</goal></goals>
               <configuration>
                 <createDependencyReducedPom>false</createDependencyReducedPom>
                 <filters>
                   <filter>
                     <artifact>*:*</artifact>
                     <excludes>
                       <exclude>META-INF/*.SF</exclude>
                       <exclude>META-INF/*.DSA</exclude>
                       <exclude>META-INF/*.RSA</exclude>
                     </excludes>
                   </filter>
   <!--                <filter>-->
   <!--                  
<artifact>org.apache.flink:flink-table-planner-loader</artifact>-->
   <!--                  <excludes>-->
   <!--                    &lt;!&ndash; 移除掉冲突的 Service 文件 &ndash;&gt;-->
   <!--                    
<exclude>META-INF/services/org.apache.flink.table.planner.loader.DelegateExecutorFactory</exclude>-->
   <!--                  </excludes>-->
   <!--                </filter>-->
                 </filters>
                 <transformers>
   
                   <!-- 关键:合并所有SPI服务文件 -->
                   <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                   <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                     <mainClass>com.example.DorisFlinkJob</mainClass>
                   </transformer>
   
                 </transformers>
               </configuration>
             </execution>
           </executions>
         </plugin>
       </plugins>
     </build>
   
   </project>    
   
   ### Error Exception
   
   ```log
   Caused by: org.apache.flink.table.api.ValidationException: Multiple 
factories for identifier 'default' that implement 
'org.apache.flink.table.delegation.ExecutorFactory' found in the classpath.
   
   Ambiguous factory classes are:
   
   org.apache.flink.table.planner.delegation.DefaultExecutorFactory
   org.apache.flink.table.planner.loader.DelegateExecutorFactory
        at 
org.apache.flink.table.factories.FactoryUtil.discoverFactory(FactoryUtil.java:639)
        at 
org.apache.flink.table.api.bridge.internal.AbstractStreamTableEnvironmentImpl.lookupExecutor(AbstractStreamTableEnvironmentImpl.java:106)
        ... 3 more
   Disconnected from the target VM, address: '127.0.0.1:63565', transport: 
'socket'
   ```
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!(您是否要贡献这个PR?)
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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