title: Error while calling FCM backend service from Google AppEngine
body: <p>I am setting up my first app with FCM (we used GCM) and following the tutorials. I have an Android app and a servlet-based app on GAE Standard. To test it a have a servlet that sends a message to the app. </p>
  
  <p>This was working a few hours ago, I could call the servlet and received the test message on the app, but now I am only getting exceptions in the FirebaseMessaging.getInstance().sendAsync(message).get() method</p>
  
  <pre><code>com.google.firebase.messaging.FirebaseMessagingException: Error while calling FCM backend service
  </code></pre>
  
  <p>and</p>
  
  <pre><code>java.net.UnknownHostException: accounts.google.com
  </code></pre>
  
  <p>Sometimes one and sometimes the other. </p>
  
  <p>This is the method the GAE servlet calls. I have checked if the token I was using was correct and it is the one currently active in the Android device.</p>
  
  <pre><code>    final static String urlFCM = "https://fcm.googleapis.com/fcm/send";
  
  private static void initFCM() {
      FileInputStream serviceAccount;
      try {
          serviceAccount = new FileInputStream("WEB-INF/Orchestram-e2e1ceeb2481.json");
          FirebaseOptions options = new FirebaseOptions.Builder()
                  .setCredentials(GoogleCredentials.fromStream(serviceAccount))
                  .setDatabaseUrl("https://orchestram-cerqana.firebaseio.com/")
                  .build();
          FirebaseApp.initializeApp(options);
      } catch (Exception e) {
          e.printStackTrace();
      }
      /// TODO: 
  }
  
  public static String sendFCM(final JSONObject value, final String token, final boolean back) {
  
      initFCM(); 
  
      Message message = Message.builder()
              .putData("score", "850")
              .putData("time", "2:45")
              .setToken(token)
              .build();
  
      try {
          String response = FirebaseMessaging.getInstance().sendAsync(message).get();
      } catch (Exception e) {
          e.printStackTrace();
          return "ERROR";
      }
      return "HECHO";
  }
  </code></pre>