title: java.nio.channels.AsynchronousClose Exception on Java 8
body: <p>I just moved my code from java 7 windows to java 1.8 Linux and i am getting this stack trace on same code base </p>
  
  <blockquote>
    <p>java.nio.channels.AsynchronousCloseException
            at sun.nio.ch.SimpleAsynchronousFileChannelImpl$3.run(SimpleAsynchronousFileChannelImpl.java:380) [rt.jar:1.8.0_92]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_92]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_92]
            at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_92]</p>
  </blockquote>
  
  <p>My codes is as below</p>
  
  <pre><code>  Charset cs = Charset.forName("UTF-8");
          byte[] inputBytes = jsonString.getBytes(cs);
          fileChannel.write(ByteBuffer.wrap(inputBytes), 0, ByteBuffer.wrap(inputBytes),new CompletionHandler&lt;Integer, ByteBuffer&gt;() {
  
              @Override
              public void completed(Integer result, ByteBuffer attachment) {
                  log.info("Async Saving site content completed for sitename");
              }
  
              @Override
              public void failed(Throwable exc, ByteBuffer attachment) {
                  exc.printStackTrace();
                  log.error("Async File Write Failed",exc);
                  log.fatal(exc);
              }
          });
  </code></pre>
  
  <p>Wonder what is happening. Any help is appreciated.</p>