Skip to content

APNS notfications are failing at the Server end , getting Connection time out issues #71

Closed
lalaasray opened this Issue May 9, 2012 · 3 comments

4 participants

@lalaasray

Hi ,
I am using a Linux server .I have the required certificate installed .
While sending notifications some times it works and at times it fails i.e very second notification is failing

[09 May 2012 12:44:49,435] WARN [SimpleAsyncTaskExecutor-2] com.notnoop.apns.internal.ApnsFeedbackConnection - Failed to retreive invalid devices
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(SSLSocketImpl.java:365)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)
at com.notnoop.apns.internal.ApnsFeedbackConnection.getInactiveDevicesImpl(ApnsFeedbackConnection.java:85)
at com.notnoop.apns.internal.ApnsFeedbackConnection.getInactiveDevices(ApnsFeedbackConnection.java:67)
at com.notnoop.apns.internal.AbstractApnsService.getInactiveDevices(AbstractApnsService.java:99)

[09 May 2012 12:44:49,435] ERROR [http-8040-1] com.notnoop.apns.internal.ApnsConnectionImpl - Couldn't connect to APNS server
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(SSLSocketImpl.java:365)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)
at com.notnoop.apns.internal.ApnsConnectionImpl.socket(ApnsConnectionImpl.java:133)
at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:160)
at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)
at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:52)
at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:36)
[09 May 2012 12:48:00,539] WARN [http-8040-1] com.notnoop.apns.internal.ApnsFeedbackConnection - Failed to retreive invalid devices
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(SSLSocketImpl.java:365)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)
at com.notnoop.apns.internal.ApnsFeedbackConnection.getInactiveDevicesImpl(ApnsFeedbackConnection.java:85)
at com.notnoop.apns.internal.ApnsFeedbackConnection.getInactiveDevices(ApnsFeedbackConnection.java:67)
at com.notnoop.apns.internal.AbstractApnsService.getInactiveDevices(AbstractApnsService.java:99)
at com.notnoop.apns.internal.ApnsServiceImpl.getInactiveDevices(ApnsServiceImpl.java:36)

com.notnoop.apns.internal.ApnsFeedbackConnection - Failed to retreive invalid device

Also I get INVALID_TOKEN exception

java.net.ConnectException: Connection timed out

Can you let me know if there is something I need to take care in the code or some server parameters that I need to be set / modified for Java APNS to work.

Thanks in advance

Lala Ray

@emadhegab

did you find a solution for that..i'm facing the same problem

@Moocar
Moocar commented Apr 12, 2013

I'm seeing exactly the same behavior. Except the DeliveryError is "UNKNOWN"

@froh42
Collaborator
froh42 commented May 21, 2014

When you send an invalid token APNS closes the connection and there was a bug of apns not reopening the connection at once. This should be fixed.

However there's still #104 which I'll need to look into as well.

@froh42 froh42 closed this May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.