[ 
https://issues.apache.org/jira/browse/PHOENIX-6348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275282#comment-17275282
 ] 

Istvan Toth commented on PHOENIX-6348:
--------------------------------------

[~jisaac]
After spending the day on this, I finally realized that we do not even have 
org.apache.commons.cli.DefaultParser in phoenix-client.

We are shading and relocating the world into phoenix-client, including 
org.apache.commons.cli.

Either you've tried to bulkload with phoenix-core, instead if phoenix-client, 
or we have some extremely bizarre shading error in the 4.x build.

This is the output of whatever midnight commander uses to display java class 
information:
{noformat}
 [] [64-bit architecture=5009249] [architecture=6382440] [64-bit 
architecture=6513967] [architecture=7303020]
Compiled from "CsvBulkLoadTool.java"
public class org.apache.phoenix.mapreduce.CsvBulkLoadTool extends 
org.apache.phoenix.mapreduce.AbstractBulkLoadTool {
  static final org.apache.phoenix.shaded.org.apache.commons.cli.Option 
DELIMITER_OPT;
  static final org.apache.phoenix.shaded.org.apache.commons.cli.Option 
QUOTE_OPT;
  static final org.apache.phoenix.shaded.org.apache.commons.cli.Option 
ESCAPE_OPT;
  static final org.apache.phoenix.shaded.org.apache.commons.cli.Option 
ARRAY_DELIMITER_OPT;
  static final org.apache.phoenix.shaded.org.apache.commons.cli.Option 
binaryEncodingOption;
  public org.apache.phoenix.mapreduce.CsvBulkLoadTool();
  protected org.apache.phoenix.shaded.org.apache.commons.cli.Options 
getOptions();
  protected void 
configureOptions(org.apache.phoenix.shaded.org.apache.commons.cli.CommandLine, 
java.util.List<org.apache.phoenix.util.ColumnInfo>, 
org.apache.hadoop.conf.Configuration) throws java.sql.SQLE
xception;
  protected void setupJob(org.apache.hadoop.mapreduce.Job);
  public static void main(java.lang.String[]) throws java.lang.Exception;
  static {};
}
{noformat}

(BTW the HBase 0.96.1 workaround in the docs is not needed/doesn't work for the 
same reason)

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

Reply via email to