title: Http 500 Internal Server Error in Android
body: <p>Android code</p>
  
  <pre><code>class BirthdayTask extends AsyncTask&lt;String, String, String&gt;{
  
          @Override
          protected String doInBackground(String... uri) {
              HttpClient httpclient = new DefaultHttpClient();
              HttpResponse response;
              String responseString = null;
              try {
                  System.out.println(uri[0]);
                  response = httpclient.execute(new HttpGet(uri[0]));
                  StatusLine statusLine = response.getStatusLine();
                  if(statusLine.getStatusCode() == HttpStatus.SC_OK){
                      ByteArrayOutputStream out = new ByteArrayOutputStream();
                      response.getEntity().writeTo(out);
                      out.close();
                      responseString = out.toString();
                      System.out.println("responseString"+responseString);
                  } else{
                      //Closes the connection.
                      response.getEntity().getContent().close();
                      throw new IOException(statusLine.getReasonPhrase());
                  }
              } catch (ClientProtocolException e) {
                  //TODO Handle problems..
              } catch (Exception e) {
                  e.printStackTrace();
              }
              return responseString;
          }
  
  
          @Override
          protected void onPostExecute(String result) {
              super.onPostExecute(result);
              /* System.out.println(result);
              System.out.println(result);
              System.out.println(result);*/
          }
  
      }
  
  
   @RequestMapping(value="here is my url" ,method=RequestMethod.GET)
          public @ResponseBody String Test(HttpServletRequest req) {
  
              Gson gson = new Gson();
  
              Domain domain = (Domain)req.getSession().getAttribute("Domain");
              List&lt;UserProfile&gt; userProfiles = userProfileManager.getUpcomingBirthday(domain.getDomainId(),15);
  
              return gson.toJson(userProfiles);
          }
  </code></pre>
  
  <p>Webservice</p>
  
  <p>This is the webservice I am calling from browser its working fine. But when I call from Android then I get a <strong>500 internal server error</strong>. But in server logs I see no error.</p>
  
  <p>What is going wrong?</p>