title: java.io.IOException: Invalid argument
body: <p>I have a web application running in cluster mode with a load balancer.
  It consists in two tomcats (T1, and T2) addressing only one DB.
  T2 is nfs mounted to T1. This is the only dofference between both nodes.</p>
  
  <p>I have a java method generating some files. If the request
  runs on T1 there is no problem but if the request is running on node 2
  I get an exception as follows:</p>
  
  <pre><code>java.io.IOException: Invalid argument
          at java.io.FileOutputStream.close0(Native Method)
          at java.io.FileOutputStream.close(FileOutputStream.java:279)
  </code></pre>
  
  <p>The corresponding code is as follows:</p>
  
  <pre><code>for (int i = 0; i &lt; dataFileList.size(); i++) {
      outputFileName = outputFolder + fileNameList.get(i);
      FileOutputStream fileOut = new FileOutputStream(outputFileName);                        
      fileOut.write(dataFileList.get(i), 0, dataFileList.get(i).length);
      fileOut.flush();
      fileOut.close();
  }
  </code></pre>
  
  <p>The exception appears at the fileOut.close()</p>
  
  <p>Any hint?</p>
  
  <p>Luis</p>