Skip to content

Commit 5eb5dc4

Browse files
committed
Upgrade hadoop common dependencies to support compile/runtime JDK17 support.
1 parent 1ef4245 commit 5eb5dc4

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

Writerside/topics/Release-Notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ The latest set of enhancement requests can be found [here](https://github.com/cl
1010

1111
If there is something you'd like to see, add a new issue [here](https://github.com/cloudera-labs/hms-mirror/issues)
1212

13+
## 3.1.0.0
14+
15+
**What's New**
16+
Upgraded `hadoop-common` to 3.4.1 for JDK17 compile-time compatibility. This avoids the need to `add-exports` for the `java.naming` module.
17+
18+
1319
## 3.0.0.2
1420

1521
**Bug Fixes**

Writerside/topics/troubleshooting.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Troubleshooting
22

3+
## Error on Startup `cannot access LdapCtxFactory`
4+
5+
This happens with `hms-mirror` 3.0.0.1-3.0.0.4 and **OracleJDK 17**.
6+
7+
**Error**
8+
```
9+
Caused by: java.lang.IllegalStateException: java.lang.IllegalAccessError: class org.apache.hadoop.security.LdapGroupsMapping
10+
(in unnamed module @0x30ee2816) cannot access class com.sun.jndi.ldap.LdapCtxFactory (in module java.naming)
11+
because module java.naming does not export com.sun.jndi.ldap to unnamed module @0x30ee2816
12+
```
13+
14+
**Solution**
15+
The OracleJDK 17 is pretty strict about accessing modules with older code compiled with Java 8. The hadoop common libraries we're using where compiled with JDK 8 and are trying to access the `LdapCtxFactory` class in the `java.naming` module.
16+
17+
Add the following environment variable before starting `hms-mirror`:
18+
19+
```bash
20+
export JAVA_OPTS="--add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED"
21+
````
22+
323
## Application doesn't seem to be making progress
424

525
All the counters for table processing aren't moving (review the hms-mirror.log) or (1.6.1.0+) the on screen logging of what tables are being added and metadata collected for has stopped.

pom.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
<parent>
2323
<groupId>com.cloudera.utils</groupId>
2424
<artifactId>hadoop.parent</artifactId>
25-
<version>1.4.0.0</version>
25+
<version>1.5.0.0</version>
2626
<relativePath>../cloudera-utils</relativePath>
2727
</parent>
2828

2929
<groupId>com.cloudera.utils.hadoop</groupId>
3030
<artifactId>hms-mirror</artifactId>
31-
<version>3.0.0.4</version>
31+
<version>3.1.0.0</version>
3232
<packaging>jar</packaging>
3333

3434
<name>hms-mirror</name>
@@ -53,7 +53,7 @@
5353
<commonmark.version>0.17.1</commonmark.version>
5454
<cdp.scope>compile</cdp.scope>
5555

56-
<hadoop-cli.version>3.1.0.1</hadoop-cli.version>
56+
<hadoop-cli.version>3.2.0.0</hadoop-cli.version>
5757
<hive-sre.version>3.0.1.8</hive-sre.version>
5858

5959
</properties>
@@ -84,7 +84,7 @@
8484
<dependency>
8585
<groupId>org.apache.hadoop</groupId>
8686
<artifactId>hadoop-mapreduce</artifactId>
87-
<version>${hadoop.version}.${cdp.version}</version>
87+
<version>${hadoop.version}</version>
8888
<scope>${cdp.scope}</scope>
8989
<type>pom</type>
9090
<exclusions>
@@ -113,7 +113,7 @@
113113
<dependency>
114114
<groupId>org.apache.hadoop</groupId>
115115
<artifactId>hadoop-distcp</artifactId>
116-
<version>${hadoop.version}.${cdp.version}</version>
116+
<version>${hadoop.version}</version>
117117
<scope>${cdp.scope}</scope>
118118
</dependency>
119119

@@ -206,6 +206,7 @@
206206
<plugins>
207207
<plugin>
208208
<artifactId>maven-jar-plugin</artifactId>
209+
<version>3.4.2</version>
209210
<configuration>
210211
<archive>
211212
<manifest>

src/main/java/com/cloudera/utils/hms/mirror/datastrategy/StorageMigrationDataStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import com.cloudera.utils.hms.util.TableUtils;
3636
import lombok.Getter;
3737
import lombok.extern.slf4j.Slf4j;
38-
import org.apache.commons.lang.StringUtils;
38+
import org.apache.commons.lang3.StringUtils;
3939
import org.springframework.stereotype.Component;
4040

4141
import java.text.MessageFormat;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.cloudera.utils.hms.mirror.domain.support;
2+
3+
public enum HiveDriverEnum {
4+
}

0 commit comments

Comments
 (0)