[ 
https://issues.apache.org/jira/browse/PHOENIX-6133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihir Monani updated PHOENIX-6133:
----------------------------------
    Description: 
The issue here is :- # HBase does not have any fat JARs in it's libs folder 
i.e. they don't bundle any JAR in hbase.tar.gz 
 # When Phoenix builds phoenix-client JAR, it includes many upstream JARs as 
part of the JAR.
 # If any application is bundling all upstream JARs with it's transitive 
dependency also (like STAX2 and WOODSTOX JARs comes from hadoop-common) then 
they create conflicts and throws errors during calls like 

{code:java}
HBaseConfiguration.create()
{code}
Error Stack Trace :-
{code:java}
Exception in thread "main" java.lang.NoSuchMethodError: 
com.ctc.wstx.stax.WstxInputFactory.createSR(Lcom/ctc/wstx/api/ReaderConfig;Lcom/ctc/wstx/io/SystemId;Lcom/ctc/wstx/io/InputBootstrapper;ZZ)Lorg/codehaus/stax2/XMLStreamReader2;
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2752)
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2736)
        at 
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2787)
        at 
org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2761)
        at 
org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2641)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:1103)
        at 
org.apache.hadoop.conf.Configuration.getTrimmed(Configuration.java:1157)
        at 
org.apache.hadoop.conf.Configuration.getBoolean(Configuration.java:1562)
        at 
org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:73)
        at 
org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:87)
        at 
org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:102)
        at com.project.service.ServiceStart.main(ServiceStart.java:198)
{code}
To avoid this kind of issues, we should start excluding JARs from 
phoenix-client JARs which are part of upstream project's transitive dependency.

One such instance is to exclude STAX2 and WOODSTOX jars from phoenix-client JAR.


This is happening with below code version :-

Hadoop :- 2.10 (between 2.7 and 2.10 , above mentioned JARs are introduced.)
HBase :- 1.6
Phoenix :- 4.14.3

  was:
The issue here is :- # HBase does not have any fat JARs in it's libs folder 
i.e. they don't bundle any JAR in hbase.tar.gz 
 # When Phoenix builds phoenix-client JAR, it includes many upstream JARs as 
part of the JAR.
 # If any application is bundling all upstream JARs with it's transitive 
dependency also (like STAX2 and WOODSTOX JARs comes from hadoop-common) then 
they create conflicts and throws errors during calls like 

{code:java}
HBaseConfiguration.create()
{code}
Error Stack Trace :-
{code:java}
Exception in thread "main" java.lang.NoSuchMethodError: 
com.ctc.wstx.stax.WstxInputFactory.createSR(Lcom/ctc/wstx/api/ReaderConfig;Lcom/ctc/wstx/io/SystemId;Lcom/ctc/wstx/io/InputBootstrapper;ZZ)Lorg/codehaus/stax2/XMLStreamReader2;
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2752)
        at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2736)
        at 
org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2787)
        at 
org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2761)
        at 
org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2641)
        at org.apache.hadoop.conf.Configuration.get(Configuration.java:1103)
        at 
org.apache.hadoop.conf.Configuration.getTrimmed(Configuration.java:1157)
        at 
org.apache.hadoop.conf.Configuration.getBoolean(Configuration.java:1562)
        at 
org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:73)
        at 
org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:87)
        at 
org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:102)
        at com.project.service.ServiceStart.main(ServiceStart.java:198)
{code}
To avoid this kind of issues, we should start excluding JARs from 
phoenix-client JARs which are part of upstream project's transitive dependency.

One such instance is to exclude STAX2 and WOODSTOX jars from phoenix-client JAR.


> Exclude transitive dependency of hadoop-common STAX2 and WOODSTOX jars from 
> phoenix-client JAR
> ----------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6133
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6133
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Mihir Monani
>            Assignee: Mihir Monani
>            Priority: Major
>
> The issue here is :- # HBase does not have any fat JARs in it's libs folder 
> i.e. they don't bundle any JAR in hbase.tar.gz 
>  # When Phoenix builds phoenix-client JAR, it includes many upstream JARs as 
> part of the JAR.
>  # If any application is bundling all upstream JARs with it's transitive 
> dependency also (like STAX2 and WOODSTOX JARs comes from hadoop-common) then 
> they create conflicts and throws errors during calls like 
> {code:java}
> HBaseConfiguration.create()
> {code}
> Error Stack Trace :-
> {code:java}
> Exception in thread "main" java.lang.NoSuchMethodError: 
> com.ctc.wstx.stax.WstxInputFactory.createSR(Lcom/ctc/wstx/api/ReaderConfig;Lcom/ctc/wstx/io/SystemId;Lcom/ctc/wstx/io/InputBootstrapper;ZZ)Lorg/codehaus/stax2/XMLStreamReader2;
>       at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2752)
>       at org.apache.hadoop.conf.Configuration.parse(Configuration.java:2736)
>       at 
> org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2787)
>       at 
> org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2761)
>       at 
> org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2641)
>       at org.apache.hadoop.conf.Configuration.get(Configuration.java:1103)
>       at 
> org.apache.hadoop.conf.Configuration.getTrimmed(Configuration.java:1157)
>       at 
> org.apache.hadoop.conf.Configuration.getBoolean(Configuration.java:1562)
>       at 
> org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:73)
>       at 
> org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:87)
>       at 
> org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:102)
>       at com.project.service.ServiceStart.main(ServiceStart.java:198)
> {code}
> To avoid this kind of issues, we should start excluding JARs from 
> phoenix-client JARs which are part of upstream project's transitive 
> dependency.
> One such instance is to exclude STAX2 and WOODSTOX jars from phoenix-client 
> JAR.
> This is happening with below code version :-
> Hadoop :- 2.10 (between 2.7 and 2.10 , above mentioned JARs are introduced.)
> HBase :- 1.6
> Phoenix :- 4.14.3



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to