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

NoClassDefFoundError on Android platform #8654

Closed
mrniko opened this issue Dec 13, 2018 · 1 comment
Closed

NoClassDefFoundError on Android platform #8654

mrniko opened this issue Dec 13, 2018 · 1 comment
Assignees
Milestone

Comments

@mrniko
Copy link

mrniko commented Dec 13, 2018

Expected behavior

No exception

Actual behavior

Exception arise during invocation DnsServerAddressStreamProviders.platformDefault method in Android application:

java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/naming/directory/InitialDirContext;
        at io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider.<clinit>(DefaultDnsServerAddressStreamProvider.java:68)
        at io.netty.resolver.dns.UnixResolverDnsServerAddressStreamProvider.parseSilently(UnixResolverDnsServerAddressStreamProvider.java:76)
        at io.netty.resolver.dns.DnsServerAddressStreamProviders.<clinit>(DnsServerAddressStreamProviders.java:32)
        at io.netty.resolver.dns.DnsServerAddressStreamProviders.platformDefault(DnsServerAddressStreamProviders.java:45)

Steps to reproduce

execute DnsServerAddressStreamProviders.platformDefault method

Netty version

4.1.31.Final

@normanmaurer normanmaurer added this to the 4.1.33.Final milestone Dec 13, 2018
normanmaurer added a commit that referenced this issue Dec 13, 2018
…rverAddressStreamProvider.

Motivation:

Andoid does not contain javax.naming.* so we should not try to use it to prevent a NoClassDefFoundError on init.

Modifications:

Only try to use javax.naming.* to retrieve nameservers when not using Android.

Result:

Fixes #8654.
@normanmaurer normanmaurer self-assigned this Dec 13, 2018
@normanmaurer
Copy link
Member

@mrniko thanks for reporting... should be fixed by #8656

normanmaurer added a commit that referenced this issue Dec 14, 2018
…rverAddressStreamProvider. (#8656)

Motivation:

Andoid does not contain javax.naming.* so we should not try to use it to prevent a NoClassDefFoundError on init.

Modifications:

Only try to use javax.naming.* to retrieve nameservers when not using Android.

Result:

Fixes #8654.
normanmaurer added a commit that referenced this issue Dec 14, 2018
…rverAddressStreamProvider. (#8656)

Motivation:

Andoid does not contain javax.naming.* so we should not try to use it to prevent a NoClassDefFoundError on init.

Modifications:

Only try to use javax.naming.* to retrieve nameservers when not using Android.

Result:

Fixes #8654.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants