[
https://issues.apache.org/jira/browse/HBASE-26546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sean Busbey resolved HBASE-26546.
---------------------------------
Resolution: Fixed
> hbase-shaded-client missing required thirdparty classes under hadoop 3.3.1
> --------------------------------------------------------------------------
>
> Key: HBASE-26546
> URL: https://issues.apache.org/jira/browse/HBASE-26546
> Project: HBase
> Issue Type: Bug
> Components: Client, hadoop3, shading
> Affects Versions: 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9
> Reporter: Bryan Beaudreault
> Assignee: Bryan Beaudreault
> Priority: Major
> Fix For: 2.5.0, 2.6.0, 3.0.0-alpha-3, 2.4.10
>
>
> In HBASE-25792, the shaded thirdparty libraries from hadoop were removed from
> the hbase-shaded-client fat jar to satisfy invariant checks. Unfortunately
> this causes users of hbase-shaded-client to fail, because required classes
> are not available at runtime.
> The specific failure I'm seeing is when trying to call new Configuration(),
> which results in:
>
>
> {code:java}
> Caused by: java.lang.NoClassDefFoundError:
> org/apache/hadoop/thirdparty/com/google/common/base/Preconditions
> at
> org.apache.hadoop.conf.Configuration$DeprecationDelta.<init>(Configuration.java:430)
>
> at
> org.apache.hadoop.conf.Configuration$DeprecationDelta.<init>(Configuration.java:443)
>
> at
> org.apache.hadoop.conf.Configuration.<clinit>(Configuration.java:525){code}
>
>
> If you take a look at the hbase-shaded-client fat jar, it contains the
> org.apache.hadoop.conf.Configuration class as you'd expect. If you decompile
> that class (or look at the 3.3.1 source), you'll see that there is an import
> for org.apache.hadoop.thirdparty.com.google.common.base.Preconditions but the
> fat jar does not provide it.
>
> One way for clients to get around this is to add an explicit dependency on
> hadoop-shaded-guava, but this is problematic for a few reasons:
>
> - it's best practice to use maven-dependency-plugin to disallow declared,
> unused dependencies (which this would be)
> - it requires users to continually keep the version of hadoop-shaded-guava
> up-to-date over time.
> - it only covers guava, but there is also protobuf and potentially other
> shaded libraries in the future.
>
> I think we should remove the exclusion of
> {{org/apache/hadoop/thirdparty/**/*}} from the shading config and instead add
> that pattern to the allowlist so that hbase-shaded-client is all clients need
> to get started with hbase.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)