firebase / quickstart-java

Quickstart samples for Firebase Java Admin SDK
Apache License 2.0
234 stars 143 forks source link

Failed to send messages to FCM. #28

Open seuer opened 5 years ago

seuer commented 5 years ago
  I  use the  java server side sample then change the my  `project_id` variable in `com.google.firebase.quickstart.Messaging.java' . The following logs show in my project. I  don't know why.

java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) 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:973) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:77) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981) at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:283) at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307) at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:384) at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489) at jp.co.kyocera.thp.sendNotice.service.Messaging.getAccessToken(Messaging.java:50) at jp.co.kyocera.thp.sendNotice.service.Messaging.getConnection(Messaging.java:68) at jp.co.kyocera.thp.sendNotice.service.Messaging.sendMessage(Messaging.java:83) at jp.co.kyocera.thp.sendNotice.service.Messaging.sendCommonMessage(Messaging.java:191)

seuer commented 5 years ago

I have generated my account-service.json file. My project is virtually same as the quick-java simple.

no-today commented 4 years ago

I also encountered the same problem, how did you solve it in the end?