title: H2 webserver failing on Jetty restart
body: <p>We have our (new) build setup with the H2 web server starting up using the following Spring bean:</p>
  
  <pre><code>&lt;bean id="org.h2.tools.Server-WebServer" class="org.h2.tools.Server"
      factory-method="createWebServer" depends-on="dataSource" init-method="start"
      lazy-init="false"&gt;
      &lt;constructor-arg value="-web,-webPort,8082" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This works fine for the other three developers (who all run a Mac or Linux), but poor me on my Windows laptop gets into trouble whenever Jetty restarts after finding a change in the code:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name
  'org.h2.tools.Server-WebServer' defined in ServletContext resource [/WEB-INF/spring/appServlet/controllers.xml]:
  Invocation of init method failed; nested exception is org.h2.jdbc.JdbcSQLException:
  Exception opening port "8082" (port may be in use), cause: "java.net.BindException: Address already in use: JVM_Bind" [90061-154]
  </code></pre>
  
  <p>The theory is that the port is not properly released when Jetty signals the restart, and/or H2 doesn't re-use the port.</p>
  
  <p>Now my question: How can I fix this? I figured it'd be a common problem, but I couldn't find anything about it.</p>