title: Problems in setting up my own Stanford CoreNLP server:
body: <p>I'm setting up my own stanford parser server following the tutorial in <a href="http://stanfordnlp.github.io/CoreNLP/corenlp-server.html" rel="nofollow">http://stanfordnlp.github.io/CoreNLP/corenlp-server.html</a>. However, when I paste the example code, it comes out an error:</p>
  
  <pre><code>Exception in thread "Thread-1" edu.stanford.nlp.io.RuntimeIOException: Could not connect to server: localhost:9000
  at edu.stanford.nlp.pipeline.StanfordCoreNLPClient$2.run(StanfordCoreNLPClient.java:393)
  Caused by: java.net.ConnectException: Connection refused: connect
  at java.net.DualStackPlainSocketImpl.connect0(Native Method)
  at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
  at java.net.Socket.connect(Socket.java:589)
  at java.net.Socket.connect(Socket.java:538)
  at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
  at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
  at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
  at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:211)
  at sun.net.www.http.HttpClient.New(HttpClient.java:308)
  at sun.net.www.http.HttpClient.New(HttpClient.java:326)
  at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
  at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
  at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
  at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
  at edu.stanford.nlp.pipeline.StanfordCoreNLPClient$2.run(StanfordCoreNLPClient.java:374)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>import java.util.*;
  import edu.stanford.nlp.pipeline.Annotation;
  import edu.stanford.nlp.pipeline.StanfordCoreNLPClient;
  
  public class tagger {
      public static void test(){
          // creates a StanfordCoreNLP object with POS tagging, lemmatization, NER, parsing, and coreference resolution
          Properties props = new Properties();
  
          props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
  
          StanfordCoreNLPClient pipeline = new StanfordCoreNLPClient(props, "localhost", 9000, 2);
          // read some text in the text variable
          String text = "How are you today?";
          // create an empty Annotation just with the given text
          Annotation document = new Annotation(text);
          // run all Annotators on this text
          pipeline.annotate(document);
      }
  
      public static void main(String[] args){
          test();
      }
  }
  </code></pre>