Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

lgxbslgx
Copy link
Contributor

@lgxbslgx lgxbslgx commented Jun 7, 2022

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
Copy link
Contributor Author

lgxbslgx commented Jun 8, 2022

@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
Member

@lgxbslgx - thanks for your contribution!

@lgxbslgx lgxbslgx deleted the issue-15349 branch June 10, 2022 01:38
@lgxbslgx
Copy link
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

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

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

@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