title: Java servlet request javax.xml.stream.XMLStreamException - Premature end of file
body: <p>I am trying to read and parse an rss feed from a 2 jetty servers (Eclipse - Google Plugin): one with App engine SDK enabled and one without it. 
  1. When i test on the jetty run with app engine enabled it works fine
  2. When i use the same code on a jetty server without app engine enabled i get the following message (because the received text is empty):</p>
  
  <p>javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
  Message: Premature end of file.</p>
  
  <p>I searched the code for a premature reading of the input stream (I use new URL(host) and url.openStream() to read the input), but the code is OK (if it wasn't it wouldn't probably work in the first case). </p>
  
  <p>I used tcpdump (-s 1024 -l -A dst host.com -i wlan0) to examine the headers:</p>
  
  <ol>
  <li><p>first case:</p>
  
  <p>GET /rss/... HTTP/1.1</p>
  
  <p>Host: www.host.com</p>
  
  <p>Connection: Keep-Alive</p>
  
  <p>Cookie: environment=a%3A2%3A%7Bs%3A4%3A%22skin%22%3Bs%3A7%3A%22default%22%3Bs%3A4%3A%22lang%22%3Bs%3A5%3A%22ro_RO%22%3B%7D; isPC=1</p>
  
  <p>Cookie2: $Version=1</p></li>
  <li><p>second case: </p>
  
  <p>GET /rss/... HTTP/1.1</p>
  
  <p>Cache-Control: no-cache</p>
  
  <p>Pragma: no-cache</p>
  
  <p>User-Agent: Java/1.6.0_39</p>
  
  <p>Host: www.host.com</p>
  
  <p>Accept: text/html, image/gif, image/jpeg, *; q=.2, <em>/</em>; q=.2</p>
  
  <p>Connection: keep-alive</p></li>
  </ol>
  
  <p>Could those headers be the issue ? Is there a way to set the exact same headers ? And would it solve the problem ?</p>