NPE if connection fails and callback is not provided
----------------------------------------------------

                 Key: GERONIMO-3711
                 URL: https://issues.apache.org/jira/browse/GERONIMO-3711
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: AsyncHttpClient
    Affects Versions: 1.x
            Reporter: Sangjin Lee
            Priority: Minor


Callbacks are now optional as it is no longer the only way to handle the result 
from asynchronous requests.  In the implementation, the callbacks are now 
included as part of completing the ResponseFuture.  Thus, as the operations 
complete, the callbacks should be invoked (if set) inside ResponseFuture.

If connection fails, the connect future object gets invoked, but the current 
connect future (AsyncHttpClient.FutureListener) contains direct calls to 
AsyncHttpClientCallback.onException().  There are two problems with this: (1) 
callbacks may be null, so this may result in NPE, and (2) future will not be 
completed if connection fails.

The solution is to properly set the exception on the ResponseFuture, and that 
will take care of the callback invocation as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to