beryllw commented on PR #1359:
URL: https://github.com/apache/fluss/pull/1359#issuecomment-3236474849

   Shade the `org.apache.commons` package in the Fluss component to avoid 
conflicts with Hadoop's built-in version.
   env: hadoop-3.2.2, fluss-0.7
   Use the system's Hadoop dependencies and integrate them into Fluss's 
classpath by executing:`FLUSS_CLASSPATH="$FLUSS_CLASSPATH":"$HADOOP_CLASSPATH"`.
   ```
   Exception in thread "main" java.lang.NoSuchMethodError: 
'org.apache.commons.cli.Option$Builder 
org.apache.commons.cli.Option.builder(java.lang.String)'
           at 
com.alibaba.fluss.server.cli.CommandLineOptions.<clinit>(CommandLineOptions.java:31)
           at 
com.alibaba.fluss.server.cli.ServerConfigurationParserFactory.options(ServerConfigurationParserFactory.java:34)
           at 
com.alibaba.fluss.server.cli.ServerConfigurationParserFactory.getOptions(ServerConfigurationParserFactory.java:42)
           at 
com.alibaba.fluss.server.cli.CommandLineParser.parse(CommandLineParser.java:40)
           at 
com.alibaba.fluss.server.utils.ConfigurationParserUtils.loadCommonConfiguration(ConfigurationParserUtils.java:53)
           at 
com.alibaba.fluss.server.ServerBase.loadConfiguration(ServerBase.java:76)
           at 
com.alibaba.fluss.server.coordinator.CoordinatorServer.main(CoordinatorServer.java:152)
   ```
   
   ```
   grep -r 'org.apache.commons.cli.Option' /lib/hadoop
   Binary file /lib/hadoop/lib/commons-cli-1.2.jar matches
   
   grep -r 'org.apache.commons.cli.Option' /usr/local/fluss
   Binary file 
/usr/local/fluss/plugins/paimon/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar 
matches
   Binary file /usr/local/fluss/lib/fluss-server-0.7.0.jar matches
   ```
   The conflict arises because both versions are present in the classpath:
   Hadoop 3.2.2 provides `commons-cli-1.2.jar` in /lib/hadoop/lib/
   Fluss 0.7.0 contains newer versions in `fluss-server-0.7.0.jar` and 
`flink-shaded-hadoop-2-uber-2.8.3-10.0.jar`


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