Skip to content

[fix][client] Fix JDK17 compatibility issue#15964

Merged
michaeljmarshall merged 1 commit into
apache:masterfrom
lgxbslgx:issue-15349
Jun 9, 2022
Merged

[fix][client] Fix JDK17 compatibility issue#15964
michaeljmarshall merged 1 commit into
apache:masterfrom
lgxbslgx:issue-15349

Conversation

@lgxbslgx

@lgxbslgx lgxbslgx commented Jun 7, 2022

Copy link
Copy Markdown
Contributor

Fixes #15349

Motivation

When using the JDK17, pulsar-client throws exception module java.base does not export sun.net to unnamed module, it is good to fix it.

Modifications

Add --add-opens java.base/sun.net=ALL-UNNAMED to java option when using JDK17.

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-not-needed

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jun 7, 2022
@merlimat merlimat added this to the 2.11.0 milestone Jun 7, 2022
@lgxbslgx

lgxbslgx commented Jun 8, 2022

Copy link
Copy Markdown
Contributor Author

@merlimat Thanks for the review. Still waiting for another committer to review this patch.

@michaeljmarshall michaeljmarshall merged commit 9d16b91 into apache:master Jun 9, 2022
@michaeljmarshall

Copy link
Copy Markdown
Member

@lgxbslgx - thanks for your contribution!

@lgxbslgx lgxbslgx deleted the issue-15349 branch June 10, 2022 01:38
@lgxbslgx

Copy link
Copy Markdown
Contributor Author

@michaeljmarshall Thanks for the review.

nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jun 28, 2022
Fixes apache#15349

### Motivation

When using the JDK17, pulsar-client throws exception `module java.base does not export sun.net to unnamed module`, it is good to fix it.

### Modifications

Add `--add-opens java.base/sun.net=ALL-UNNAMED` to java option when using JDK17.

### Verifying this change

- [x] Make sure that the change passes the CI checks.

### Documentation

Check the box below or label this PR directly.

Need to update docs?

- [x] `doc-not-needed`

(cherry picked from commit 9d16b91)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jun 28, 2022
Fixes apache#15349

### Motivation

When using the JDK17, pulsar-client throws exception `module java.base does not export sun.net to unnamed module`, it is good to fix it.

### Modifications

Add `--add-opens java.base/sun.net=ALL-UNNAMED` to java option when using JDK17.

### Verifying this change

- [x] Make sure that the change passes the CI checks.

### Documentation

Check the box below or label this PR directly.

Need to update docs?

- [x] `doc-not-needed`

(cherry picked from commit 9d16b91)
@gracefullliam

Copy link
Copy Markdown

After configuration, a warning will be reported: Can not find org.apache.pulsar.shade.io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos', do I need to introduce 'io.netty:netty-resolver-dns-native-macos', in other words, do not add this dependency? will affect.

@michaeljmarshall

Copy link
Copy Markdown
Member

@yulin20010422 - it'd help if you provided more information about the system you're running. Would you mind opening a new ticket to discuss this further? Thanks.

@gracefullliam

Copy link
Copy Markdown

@michaeljmarshall -Thank you for your timely reply, my computer system is macOS13.4 version M1 chip. I will not have this warning when I use Win11 system. In addition, I will still report this warning when I add 'io.netty:netty-resolver-dns-native-macos' on macOS.

@BewareMyPower

Copy link
Copy Markdown
Contributor

@yulin20010422 You can open an issue to record the details steps to reproduce this issue here: https://github.com/apache/pulsar/issues

@gracefullliam

Copy link
Copy Markdown

@BewareMyPower Thankyou,I submitted a new issue.https://github.com/apache/pulsar/issues/20994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DnsResolverUtil "Cannot get DNS TTL settings from sun.net.InetAddressCachePolicy class" in Java 17

5 participants