shangguanjiang / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

Exception java.net.SocketException #237

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I have installed the development apns certificate
2.Generate keystore
3.trying to send simple notification
4.Exception java.net.SocketException: Connection reset
5.No notification received.
6.tried to debug using javapns.test.NotificationTest
7.I'm trying to send to one device.

What is the expected output? What do you see instead?

Sending notification successfully and receiving it on mobile.
I'm getting java.net.SocketException

What version of the product are you using? On what operating system?

I'm using 2.2 version on MAC 10.10.3

Please provide any additional information below.

here is the log:

Validating keystore reference: VALID  (keystore was found)
Verifying keystore content: VERIFIED  (no common mistakes detected)
0 [main] DEBUG javapns.notification.Payload  - Adding badge [45]
1 [main] DEBUG javapns.notification.Payload  - Adding sound [default]
1 [main] DEBUG javapns.notification.Payload  - Adding custom Dictionary [acme] 
= [foo]
1 [main] DEBUG javapns.notification.Payload  - Adding custom Dictionary [acme2] 
= [42]
1 [main] DEBUG javapns.notification.Payload  - Adding custom Dictionary [acme3] 
= (list)
106 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocketFactory
126 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocket to gateway.sandbox.push.apple.com:2195
483 [main] DEBUG javapns.notification.PushNotificationManager  - Initialized 
Connection to Host: [gateway.sandbox.push.apple.com] Port: [2195]: 
cb5822[SSL_NULL_WITH_NULL_NULL: 
Socket[addr=gateway.sandbox.push.apple.com/17.110.226.164,port=2195,localport=57
747]]
486 [main] DEBUG javapns.notification.PushNotificationManager  - Building Raw 
message from deviceToken and payload
486 [main] DEBUG javapns.notification.PushNotificationManager  - Built raw 
message ID 1 of total length 256
487 [main] DEBUG javapns.notification.PushNotificationManager  - Attempting to 
send notification: 
{"aps":{"badge":45,"alert":{"loc-args":["Test1","Test",2],"action-loc-key":"Open
 App","loc-key":"javapns rocks %@ %@%@","body":"My alert 
message"},"sound":"default"},"acme":"foo","acme3":["value1",2],"acme2":42}
487 [main] DEBUG javapns.notification.PushNotificationManager  -   to device: 
c9629bb4764c14f99c3a16201d2b644c7b153434601cb184a9ace2fd8149dc88
1365 [main] INFO javapns.notification.PushNotificationManager  - Attempt failed 
(Connection reset)... trying again
1366 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocket to gateway.sandbox.push.apple.com:2195
1637 [main] DEBUG javapns.notification.PushNotificationManager  - Attempting to 
send notification: 
{"aps":{"badge":45,"alert":{"loc-args":["Test1","Test",2],"action-loc-key":"Open
 App","loc-key":"javapns rocks %@ %@%@","body":"My alert 
message"},"sound":"default"},"acme":"foo","acme3":["value1",2],"acme2":42}
1637 [main] DEBUG javapns.notification.PushNotificationManager  -   to device: 
c9629bb4764c14f99c3a16201d2b644c7b153434601cb184a9ace2fd8149dc88
2482 [main] INFO javapns.notification.PushNotificationManager  - Attempt failed 
(Connection reset)... trying again
2482 [main] DEBUG javapns.communication.ConnectionToAppleServer  - Creating 
SSLSocket to gateway.sandbox.push.apple.com:2195
2757 [main] DEBUG javapns.notification.PushNotificationManager  - Attempting to 
send notification: 
{"aps":{"badge":45,"alert":{"loc-args":["Test1","Test",2],"action-loc-key":"Open
 App","loc-key":"javapns rocks %@ %@%@","body":"My alert 
message"},"sound":"default"},"acme":"foo","acme3":["value1",2],"acme2":42}
2758 [main] DEBUG javapns.notification.PushNotificationManager  -   to device: 
c9629bb4764c14f99c3a16201d2b644c7b153434601cb184a9ace2fd8149dc88
3596 [main] ERROR javapns.notification.PushNotificationManager  - Attempt to 
send Notification failed and beyond the maximum number of attempts permitted
3598 [main] ERROR javapns.notification.PushNotificationManager  - Delivery error
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:209)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
    at sun.security.ssl.InputRecord.read(InputRecord.java:503)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:961)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:735)
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)
    at java.io.OutputStream.write(OutputStream.java:75)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:402)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:350)
    at javapns.notification.PushNotificationManager.sendNotification(PushNotificationManager.java:320)
    at javapns.Push.sendPayload(Push.java:177)
    at javapns.Push.payload(Push.java:149)
    at javapns.test.NotificationTest.pushTest(NotificationTest.java:89)
    at javapns.test.NotificationTest.main(NotificationTest.java:46)
3599 [main] ERROR javapns.notification.PushNotificationManager  - Delivery 
error: java.net.SocketException: Connection reset
3599 [main] DEBUG javapns.notification.PushNotificationManager  - Reading 
responses
3600 [main] DEBUG javapns.notification.PushNotificationManager  - Closing 
connection
All notifications failed (1):
  [1] not transmitted to token c9629..9dc88  java.net.SocketException: Connection reset

Original issue reported on code.google.com by ammar....@gmail.com on 14 Apr 2015 at 8:28