[
https://issues.apache.org/jira/browse/PHOENIX-6348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275653#comment-17275653
]
Istvan Toth commented on PHOENIX-6348:
--------------------------------------
Giving it some thought, I think that we should make all tools use the server
jar.
(I am pretty sure that they all work with the server JAR, barring classpath
conflicts like this one)
The client jar contains a self-contained hadoop+hbase stack, that is shaded and
relocated within an inch of its life, and is guaranteed not to work with any
other hadoop libraries because of shading conflicts.
The server jar uses whatever Hadoop and HBase libraries are on the classpath,
and won't have shading conflicts with them. It is able to use the S3 / ABFS /
Ozone / Whatever libraries installed and configured, and work with them.
> java.lang.NoClassDefFoundError: when running with hbase-1.6
> -----------------------------------------------------------
>
> Key: PHOENIX-6348
> URL: https://issues.apache.org/jira/browse/PHOENIX-6348
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.16.0
> Reporter: Jacob Isaac
> Priority: Blocker
> Fix For: 4.16.0
>
>
> Getting this error, when running with hbase-1.6
> I think this stems from the jar dependency mismatch between phoenix 4.x/4.16
> and hbase1.6
> hbase-1.6 : commons-cli-1.2.jar
> (https://github.com/apache/hbase/blob/5ec5a5b115ee36fb28903667c008218abd21b3f5/pom.xml#L1260)
> phoenix 4.x : commons-cli-1.4.jar
> ([https://github.com/apache/phoenix/blob/44d44029597d032af1be54d5e9a70342c1fe4769/pom.xml#L100)]
>
> What is the best way to resolve this? Shading?
> [~stoty] [~vjasani]
> FYI
> [~yanxinyi] [~ChinmayKulkarni] [~kadir]
>
> **Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/cli/DefaultParser
> at
> org.apache.phoenix.mapreduce.index.IndexTool.parseOptions(IndexTool.java:354)
> at org.apache.phoenix.mapreduce.index.IndexTool.run(IndexTool.java:788)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
> at org.apache.phoenix.mapreduce.index.IndexTool.main(IndexTool.java:1201)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.cli.DefaultParser
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)