Search code examples
javafirebasenettysolarisfirebase-cloud-messaging

I don't know why occurred this? "java.nio.channels.UnresolvedAddressException"


I made program having a function to send the message to FCM server using Netty.

and I finished the tested in Windows 7.

it works well.

but solaris does not run this.

I got a exception code in solaris.

[ClientHandler.exceptionCaught] Unexpected exception from downstream.java.nio.channels.UnresolvedAddressException

this exception error is occurred after

"[ClientHandler.channelOpen]"

and then run to

"[ClientHandler.channelClosed]"

so, I did try write message to FCM Server after Immediately "[ClientHandler.channelOpen]".

message sent from FCM Server.

and got a another exception error .

"java.nio.channels.NotYetConnectedException"

that is knows that an error occurs in the above problem.

I don't know why occurred "UnresolvedAddressException".

I think that this problem occurs because the Solaris firewall.

how to handle this issue?

Add to.. Ping test results

ping 64.233.187.188
64.233.187.188 is alive

Note - this IP is gained by using the

String ip = "fcm-xmpp.googleapis.com";
int port = 5236;
new InetSocketAddress (ip, port) .getAddress () getHostAddress () 

in java.


Solution

  • I'll improve on this answer as we move along.

    You seem to have a misconfigured Solaris system. Misconfigured in terms of host name lookup.

    1. Let us know your version of Solaris. Do cat /etc/release and post the output.

    2. On Solaris there's a beast called Solaris Name Service daemon which caches name information. Other OS'es have a similar concept. All relevant system calls in Solaris asks this daemon for name information, however the nslookup tool bypasses this and asks directly from a DNS server. This is why you can have a successful nslookup, while name lookup in general do not work. Bottom line: nslookup is sometimes not the test you want to do. Use getent command instead, as in getent hosts fcm-xmpp.googleapis.com.

    3. Andrew Henley's comment is spot on. You should execute the telnet test. It gives valuable information. This is a well-known method for testing connectivity and it should be part of any IT person's toolbox whether you are a developer or a sysadmin, IMHO. (Windows people normally do not know about the 'telnet test' mainly because Microsoft has decided that the telnet client should no longer be installed by default on Windows)