title: Java Thread stops without Exception/Throwable
body: <p>I've a very annoying problem and I'm not able to fix this by myself.</p>
  
  <p>I have a simple JavaFX Scene with just 2 buttons for start and killing the thread. The stop-action is not relevant in this case because I'm not able to get the thread working well. The actionListener looks like:</p>
  
  <p><strong>EDIT1:</strong> Figured out the problem, it's <strong>not</strong> thread specific, it's the request against the TimeServer, take a look here: <a href="https://stackoverflow.com/questions/30495114/java-thread-stops-without-exception-throwable/30506720#30506720">answer</a><br>
  Thanks to everyone of you who answered this or read the question! :)</p>
  
  <pre><code>private FarmAction action = null;
  
  @FXML
  void btnStartListener(ActionEvent event) {      
  Firefox ff = new Firefox();
  ff.startBrowser();
  
  BrowserAction browserAction = new BrowserAction(ff.getDriver(), ff.getJse());
  browserAction.loginToGame(user, pass);
  ObservableList&lt;AttackCommand&gt; list = (ObservableList&lt;AttackCommand&gt;) Serializer.deserialize(Constants.FILE_NAME_TESTPURPOSE);
  
  
  if(action == null)
      action = new FarmAction(ff.getDriver(), ff.getJse(), list);
  
  Thread run = new Thread(action);
  try {
      run.start();
  } catch (Exception e) {
      e.printStackTrace();
  } catch (Throwable t) {
      t.printStackTrace();
   }
  }   
  </code></pre>
  
  <p>Note: I'm working with the Selenium Framework to automate some clicks on a 
  Website.</p>
  
  <p>My FarmAction class looks like this:</p>
  
  <pre><code>public class FarmAction implements Runnable{
  
  private WebDriver driver;
  private JavascriptExecutor jse;
  private ObservableList&lt;AttackCommand&gt; attackList;
  private boolean stop = false;
  
  public FarmAction(WebDriver driver, JavascriptExecutor jse, ObservableList&lt;AttackCommand&gt; attackList) {
      this.driver = driver;
      this.jse = jse;
      for(AttackCommand ac : attackList)
      {
          ac.transferFromPropToAttributes();
      }
      this.attackList = attackList;
  }
  
  
  @Override
  public void run() {
      ArrayList&lt;Integer&gt; unitIds = Constants.UNIT_ID_LIST_ALL;
      if(!driver.getCurrentUrl().equals(Constants.URL_TESTPURPOSE))
              driver.navigate().to(Constants.URL_TESTPURPOSE);
      int count = 0;
      while(true) { // Just let the Thread run for duration = lifetime of application
          System.out.println(count++); //count how often the thread runs into this while loop before terminating for no reason
          for(AttackCommand ac : attackList) {            
              for(int i = 0; i &lt; unitIds.size(); i ++) {
                  int unitKey = unitIds.get(i); // Momentane UnitID der Iteration                 
                  if(ac.getUnits().containsKey(unitKey) &amp;&amp; ( ac.getTurnBackTime() == 0 ||ac.getTurnBackTime() &lt;= DateUtil.getActualServerTime())) // getActualServerTime is request against the timeserver de.pool.ntp.org
                  {
                      String textfieldName = Constants.HASHMAP_TEXTFIELD_NAME_ALL_HTML_PLACE.get(unitKey);
                      WebElement textfield = driver.findElement(By.name(textfieldName));
                      textfield.sendKeys(String.valueOf(ac.getUnits().get(unitKey)));
  
                      WebElement textfieldCoordinates = driver.findElement(By.name(Constants.TEXTFIELD_NAME_HTML_PLACE_COODRINATESFORTARGET));
                      textfieldCoordinates.sendKeys(StringHelper.getPointAsString(new Point(ac.getXCoordinates(), ac.getYCoordinates())));
  
  
                      WebElement submitButton = driver.findElement(By.id(Constants.TA));
                      submitButton.click();
  
                      WebElement sndAttackSubmitButton = driver.findElement(By.name(Constants.SBM));
  
                      WebElement span = driver.findElement(By.className(Constants.CLASSNAME_TIME));
                      long duration = Long.parseLong(span.getAttribute(Constants.ATTRIBUTE_DURATION));
  
                      sndAttackSubmitButton.click();
                      ac.setStartTime(DateUtil.getActualServerTime());
                      ac.setDurationInSeconds(duration*1000);
                      ac.setTurnBackTime(ac.getStartTime()+ac.getDurationInSeconds());
                  } 
              }
          }
      }
  }}
  </code></pre>
  
  <p>As you see I've wrapped the Thread.start() method into a try-catch for Throwables AND Exceptions but I don't get any Stacktrace if the thread stops for no reason. I expected an StackOverFlow Error but I don't catch anything.</p>
  
  <p>The amount of loops my thread is working is very different. Sometimes it stops after 12, then other times after 370 or 59. All values are examples - it's different each time.</p>
  
  <p>Do you have any Ideas what I'm doing wrong?</p>
  
  <p>Thanks in advance!</p>