title: HTTP Status Code: 401 in GCMDemo
body: <p>Reference:http://developer.android.com/google/gcm/demo.html</p>
  
  <p>Server 401 when trying to send a message to my android device.</p>
  
  <pre><code>HTTP Status 500 - HTTP Status Code: 401
  
  type Exception report
  
  message HTTP Status Code: 401
  
  description The server encountered an internal error (HTTP Status Code: 401) that        prevented it from fulfilling this request.
  
  exception
  
  com.google.android.gcm.server.InvalidRequestException: HTTP Status Code: 401
  com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:177)
  com.google.android.gcm.server.Sender.send(Sender.java:121)
  com.google.android.gcm.demo.server.SendAllMessagesServlet.doPost(SendAllMessagesServ    let.java:83)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.
  </code></pre>
  
  <p>Could anybody tell me how to solve?Thank you!</p>