title: Solr Exception : org.apache.solr.common.SolrException: missing content stream
body: <p>I got this exception : </p>
  
  <pre><code>SEVERE: org.apache.solr.common.SolrException: missing content stream
      at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:69)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:1817)
      at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:639)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:141)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
      at org.eclipse.jetty.server.Server.handle(Server.java:365)
      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)
      at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:642)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
      at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
      at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>I try to index some CSV files using CURL. <b>First</b> I've tried this in shell : </p>
  
  <pre><code> curl http://localhost:8080/solr/update/csv -F "stream.file=/home/usersolr/Data/production/MyFile_1373882442023" -F  "commit=true" -F "header=false" -F "fieldnames=`cat /home/usersolr/Data/header/My_header`"
  </code></pre>
  
  <p>and it works because, I got the response:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;response&gt;
  &lt;lst name="responseHeader"&gt;&lt;int name="status"&gt;0&lt;/int&gt;&lt;int name="QTime"&gt;1782&lt;/int&gt;&lt;/lst&gt;
  &lt;/response&gt;
  </code></pre>
  
  <p><b>Then</b>, I wanted to integrate this command line within my Java application, I've written this code : </p>
  
  <pre><code>    Runtime runtime = Runtime.getRuntime();
      String cmd = "curl http://localhost:8080/solr/update/csv -F \"stream.file=/home/usersolr/Data/production/MyFile_1373882442023\" -F  \"commit=true\" -F \"header=false\" -F \"fieldnames=`cat /home/usersolr/Data/header/My_header`\"";          
      System.out.println(cmd);
      runtime.exec(cmd);
  </code></pre>
  
  <p>And I got the <code>SolrException</code>:</p>
  
  <pre><code>org.apache.solr.common.SolrException: missing content stream.
  </code></pre>
  
  <p>And my document isn't indexed. The cmd string that I display in the console is exactly the same that the shell command above.</p>
  
  <p>I don't manage the <code>getInputStream()</code> and <code>getOutputStream()</code> methods. Is it linked to my problem?</p>
  
  <p>Thanks</p>