title: Tomcat 9.027: port out of range
body: <p>I have a problem with connect my servlet with Tomcat v9.0.27.
  When I try start my servlet in IntelliJ, Tomcat give me this error:</p>
  
  <blockquote>
    <p>Error running 'Tomcat 9.0.27': port out of range:-1</p>
  </blockquote>
  
  <p>My port is 8080, I try to change port but this not help me
  Windows 10, x64</p>
  
  <p>My configuration from IntellJ:
  <a href="https://zapodaj.net/3eab70769b2ef.png.html" rel="noreferrer">https://zapodaj.net/3eab70769b2ef.png.html</a></p>
  
  <p>My code:</p>
  
  <pre><code>import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import java.io.IOException;
  import java.io.PrintWriter;
  
  @WebServlet("/hello")
  public class hello extends HttpServlet {
      protected void doPost(HttpServletRequest request, HttpServletResponse 
  response) throws ServletException, IOException {
          response.setContentType("text/html");
          response.setCharacterEncoding("UTF-8");
          PrintWriter writer = response.getWriter();
          writer.println("HelloWorld");
      }
  }
  </code></pre>
  
  <p>Anybody have any solution to this problem?</p>