PROBLEM WITH GCM IN LINUX

1

When I run a jar that I use to send a pushin using GCM in WINDOWS, I have no problems but when I run my jar in LINUX I get the following error:

  

1 [main] MAIN ERROR - IO Exception java.net.ConnectException: Expired   the connection time           at java.net.PlainSocketImpl.socketConnect (Native Method)           at java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:339)           at java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:200)           at java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:182)           at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:392)           at java.net.Socket.connect (Socket.java:579)           at sun.security.ssl.SSLSocketImpl.connect (SSLSocketImpl.java:625)           at sun.security.ssl.BaseSSLSocketImpl.connect (BaseSSLSocketImpl.java:160)           at sun.net.NetworkClient.doConnect (NetworkClient.java:180)           at sun.net.www.http.HttpClient.openServer (HttpClient.java:432)           at sun.net.www.http.HttpClient.openServer (HttpClient.java:527)           at sun.net.www.protocol.https.HttpsClient. (HttpsClient.java:275)           at sun.net.www.protocol.https.HttpsClient.New (HttpsClient.java:371)           at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient (AbstractDelegateHttpsURLConnection.java:191)           at sun.net.www.protocol.http.HttpURLConnection.plainConnect (HttpURLConnection.java:933)           at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect (AbstractDelegateHttpsURLConnection.java:177)           at sun.net.www.protocol.http.HttpURLConnection.getOutputStream (HttpURLConnection.java:1092)           at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream (HttpsURLConnectionImpl.java:250)           at com.google.android.gcm.server.Sender.post (Sender.java:479)           at com.google.android.gcm.server.Sender.post (Sender.java:458)           at com.google.android.gcm.server.Sender.sendNoRetry (Sender.java:170)           at com.google.android.gcm.server.Sender.send (Sender.java:121)           at MAIN.main (MAIN.java:41)

    
asked by renzosm23 20.05.2016 в 16:09
source

1 answer

2

At the security level, depending on the distribution you are in, for example in centos, redhat, you can verify if the port you are looking for is up with this command:

netstat -nap | grep :puerto

Example:

netstat -nap | grep :1234

To verify the firewall, if you are in version 6:

service iptables status

in version 7

systemctl status firewalld.service

You should also check SELinux, if enabled.

To verify it write getenforce

#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.

If you are in enforcing test passing it to permissive , this is done with the command

setenforce 0
    
answered by 01.06.2017 в 21:40