commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Avinash Lakshman" <avinash.laksh...@gmail.com>
Subject [Javaflow] A NullPointerException
Date Wed, 12 Nov 2008 06:17:16 GMT
I have a continuation based setup where I am trying to do asynchronous I/O.
I submit a read request and then suspend() the continuation. Later a
callback is invoked on read completion and the continuation is resumed.
However when I resume the continuation I get a NullPointerException stack
trace shown below:

Exception in thread "DISK-IO-POOL:1" java.lang.NullPointerException
      at java.nio.ByteBuffer.wrap(ByteBuffer.java:392)
      at
com.facebook.infrastructure.io.AIORandomAccessFile.doWrite(AIORandomAccessFile.java:400)
      at
com.facebook.infrastructure.io.AIORandomAccessFile.flushBuffer(AIORandomAccessFile.java:368)
      at
com.facebook.infrastructure.io.AIORandomAccessFile.seek(AIORandomAccessFile.java:509)
      at
com.facebook.infrastructure.io.AIORandomAccessFile.read(AIORandomAccessFile.java:562)
      at java.io.RandomAccessFile.readInt(RandomAccessFile.java:771)
      at
com.facebook.infrastructure.io.ReadImpl.run(AIORandomAccessFile.java:727)
      at
org.apache.commons.javaflow.bytecode.StackRecorder.execute(StackRecorder.java:94)
      at
org.apache.commons.javaflow.Continuation.execute(Continuation.java:172)
      at
org.apache.commons.javaflow.Continuation.continueWith(Continuation.java:168)
      at
com.facebook.infrastructure.io.AIORandomAccessFile$ReadCompletionHandler.completed(AIORandomAccessFile.java:132)
      at
com.facebook.infrastructure.io.AIORandomAccessFile$ReadCompletionHandler.completed(AIORandomAccessFile.java:114)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:114)
      at
sun.nio.ch.SimpleAsynchronousFileChannelImpl$3.run(SimpleAsynchronousFileChannelImpl.java:363)
      at
org.apache.commons.javaflow.bytecode.StackRecorder.execute(StackRecorder.java:94)
      at
org.apache.commons.javaflow.Continuation.execute(Continuation.java:172)
      at
org.apache.commons.javaflow.Continuation.continueWith(Continuation.java:168)
      at
com.facebook.infrastructure.concurrent.ContinuationsExecutor.runWorker(ContinuationsExecutor.java:1193)
      at
com.facebook.infrastructure.concurrent.ContinuationsExecutor$Worker.run(ContinuationsExecutor.java:608)
      at java.lang.Thread.run(Thread.java:713)

Here is the call stack before the suspend():

java.lang.Thread.run/
com.facebook.infrastructure.concurrent.ContinuationsExecutor$Worker.run/
com.facebook.infrastructure.concurrent.ContinuationsExecutor.runWorker/
org.apache.commons.javaflow.Continuation.continueWith/
org.apache.commons.javaflow.Continuation.execute/
org.apache.commons.javaflow.bytecode.StackRecorder.execute/
com.facebook.infrastructure.io.ReadImpl.run/
java.io.RandomAccessFile.readInt/
com.facebook.infrastructure.io.AIORandomAccessFile.read/
com.facebook.infrastructure.io.AIORandomAccessFile.seek/
com.facebook.infrastructure.io.AIORandomAccessFile.fillBuffer2

Could someone please advice as to what might be going on over here?

Thanks
A

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message