3 Replies Latest reply on Jan 31, 2012 9:39 PM by iron light

    [-22]Error:= Invalid argument when write with AsynchronousFile

    iron light Newbie

      I try to use AsynchronousFile for my own project.

      I got [-22]Invalid argument error.

       

      Here's the log:

       

      Jan 31, 2012 11:27:01 PM org.hornetq.core.logging.impl.JULLogDelegate error

      SEVERE: Libaio event generated errors, callback object was informed about it

      Jan 31, 2012 11:27:01 PM org.hornetq.core.logging.impl.JULLogDelegate warn

      WARNING: CallbackError: Error:= Invalid argument

       

      Here's the code[scala]:

       


      if (canWrite && !f.exists) f.createNewFile()

      val asyncFile = new AsynchronousFileImpl(null, executor)

      asyncFile.open(f.getAbsolutePath, 16) // FIXME: magic number

      asyncFile

       

       

       


      f: (Option[Throwable] => Unit) =>

          file.write(position, src.remaining, src, new AIOCallback {

              def done() {

                  f(None)

              }

              def onError(errorCode: Int, errorMessage: String) {

                  f(Some(new IOException("write error[%d]%s".format(errorCode, errorMessage))))

              }

          })

       

      Env: linux mint 11 64bit Oracle JDK 1.7.0_02 hornetq-2.2.5.Final