Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3428

NullPointerException in HttpCoreNIOSender

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: kernel
    • Labels:
      None
    • Environment:
      java 1.5, mac os x, axis2 1.3 (embedded)

      Description

      Exception in thread "HttpCoreNIOSender" java.lang.NullPointerException
      at org.apache.axis2.transport.nhttp.HttpCoreNIOSender$2.handleError(HttpCoreNIOSender.java:442)
      at org.apache.axis2.transport.nhttp.HttpCoreNIOSender$2.failed(HttpCoreNIOSender.java:412)
      at org.apache.http.impl.nio.reactor.SessionRequestImpl.failed(SessionRequestImpl.java:139)
      at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:151)
      at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:131)
      at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.execute(DefaultConnectingIOReactor.java:112)
      at org.apache.axis2.transport.nhttp.HttpCoreNIOSender.executeClientEngine(HttpCoreNIOSender.java:127)
      at org.apache.axis2.transport.nhttp.HttpCoreNIOSender.access$000(HttpCoreNIOSender.java:69)
      at org.apache.axis2.transport.nhttp.HttpCoreNIOSender$1.run(HttpCoreNIOSender.java:102)
      at java.lang.Thread.run(Thread.java:613)

      1. TestMultipleAsync.tar.gz
        16 kB
        Michele Mazzucco
      2. TestCaseAXIS2_3428.java
        2 kB
        Michele Mazzucco
      3. AXIS2-3428.patch
        8 kB
        Michele Mazzucco
      4. axis2.xml
        25 kB
        Michele Mazzucco

        Issue Links

          Activity

          Hide
          veithen Andreas Veithen added a comment -

          More information is available in the following thread: http://www.nabble.com/-Axis2--NPE-in-HttpCoreNIOSender-to14732806.html

          @Michele: Could you please attach the test case that triggers this error?

          Show
          veithen Andreas Veithen added a comment - More information is available in the following thread: http://www.nabble.com/-Axis2--NPE-in-HttpCoreNIOSender-to14732806.html @Michele: Could you please attach the test case that triggers this error?
          Hide
          veithen Andreas Veithen added a comment -

          Michele,

          Can you summarize the changes you did? (It is difficult to see this from the patch file)

          As far as I can see, you made two changes:
          1) Handle timeout differently since there is no exception object in that case.
          2) Check for null MessageReceiver.

          In the Synapse code base, the first problem was already corrected by SYNAPSE-205. For the second one, Oleg (who is the maintainer of this code) should provide feedback.

          Show
          veithen Andreas Veithen added a comment - Michele, Can you summarize the changes you did? (It is difficult to see this from the patch file) As far as I can see, you made two changes: 1) Handle timeout differently since there is no exception object in that case. 2) Check for null MessageReceiver. In the Synapse code base, the first problem was already corrected by SYNAPSE-205 . For the second one, Oleg (who is the maintainer of this code) should provide feedback.
          Hide
          asankha Asankha C. Perera added a comment -

          Michele

          I tried your test suite, but it failed for two of the methods, one being testNBSenderInOutAsync()

          Looking closely into it, I think you are using the ServiceClient.sendReceiveNonBlocking() to call an InOnlyAxisOperation which is wrong.

          I agree that when a 202 accepted response is received that the ClientHandler should not look for the MR to pass it back, but I am having trouble now trying to understand what exactly is the problem we are trying to solve..

          I am guessing your Mac OS may have something to do with any intermittent errors you are seeing, but on my Linux (Ubuntu) system, I do not see any other exceptions when I do the following:

          sender = new ServiceClient(asyncConfCtx, null);
          Options options = new Options();
          options.setTo(TARGET);
          options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
          options.setAction("urn:asyncEcho");
          sender.setOptions(options);

          for (int i = 0; i < REQUEST; i++)

          { OMElement method = factory.createOMElement("asyncEcho", omNs); OMElement value = factory.createOMElement("myValue", omNs); value.setText("Isaac Asimov, The Foundation Trilogy"); method.addChild(value); sender.sendRobust(method); TestingUtils.pause(20L); }

          asankha

          Show
          asankha Asankha C. Perera added a comment - Michele I tried your test suite, but it failed for two of the methods, one being testNBSenderInOutAsync() Looking closely into it, I think you are using the ServiceClient.sendReceiveNonBlocking() to call an InOnlyAxisOperation which is wrong. I agree that when a 202 accepted response is received that the ClientHandler should not look for the MR to pass it back, but I am having trouble now trying to understand what exactly is the problem we are trying to solve.. I am guessing your Mac OS may have something to do with any intermittent errors you are seeing, but on my Linux (Ubuntu) system, I do not see any other exceptions when I do the following: sender = new ServiceClient(asyncConfCtx, null); Options options = new Options(); options.setTo(TARGET); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); options.setAction("urn:asyncEcho"); sender.setOptions(options); for (int i = 0; i < REQUEST; i++) { OMElement method = factory.createOMElement("asyncEcho", omNs); OMElement value = factory.createOMElement("myValue", omNs); value.setText("Isaac Asimov, The Foundation Trilogy"); method.addChild(value); sender.sendRobust(method); TestingUtils.pause(20L); } asankha
          Hide
          asankha Asankha C. Perera added a comment -

          Deepal - Is point # 2 above correct? will this work with a two way transport?

          Michele, for point # 3, I am ok to implement such an interface provided Axis2 changes its transport interface to support it.. maybe you should raise it on the axis2-dev@ list for comments?

          asankha

          Show
          asankha Asankha C. Perera added a comment - Deepal - Is point # 2 above correct? will this work with a two way transport? Michele, for point # 3, I am ok to implement such an interface provided Axis2 changes its transport interface to support it.. maybe you should raise it on the axis2-dev@ list for comments? asankha
          Hide
          deepal Deepal Jayasinghe added a comment -

          About the #option 2

          • you can call sendReceiveNonBlocking() for any kind of operation but you need to keep in mind that if you call void operation with above method then you have to set the useSeparetListener=true. For in-only operation there is no problem.

          If you call void operation using sendReceiveNonBlocking() , Axis2 internally wait and give you the timeout exception.

          Thank you,
          Deepal

          Show
          deepal Deepal Jayasinghe added a comment - About the #option 2 you can call sendReceiveNonBlocking() for any kind of operation but you need to keep in mind that if you call void operation with above method then you have to set the useSeparetListener=true. For in-only operation there is no problem. If you call void operation using sendReceiveNonBlocking() , Axis2 internally wait and give you the timeout exception. Thank you, Deepal
          Hide
          dims Davanum Srinivas added a comment -

          Michele,

          Can you please upload a fresh patch.

          thanks,
          dims

          Show
          dims Davanum Srinivas added a comment - Michele, Can you please upload a fresh patch. thanks, dims
          Hide
          michelemazzucco Michele Mazzucco added a comment -

          The patch for AXIS2-3532 should fix this too.

          Michele

          Show
          michelemazzucco Michele Mazzucco added a comment - The patch for AXIS2-3532 should fix this too. Michele
          Hide
          michelemazzucco Michele Mazzucco added a comment -

          Dims,

          patch AXIS2-3532 is indeed only a workaround because it swallows the error if the message receiver is null.
          I would leave it for the 1.5 version, where (hopefully) it would be possible to use Future and other concurrency related stuff and make major changes (see my comments above).

          Michele

          Show
          michelemazzucco Michele Mazzucco added a comment - Dims, patch AXIS2-3532 is indeed only a workaround because it swallows the error if the message receiver is null. I would leave it for the 1.5 version, where (hopefully) it would be possible to use Future and other concurrency related stuff and make major changes (see my comments above). Michele
          Hide
          asankha Asankha C. Perera added a comment -

          HTTP/S NIO is not within the Axis2 project anymore. If there is any issue, please use the latest version from Synapse

          Show
          asankha Asankha C. Perera added a comment - HTTP/S NIO is not within the Axis2 project anymore. If there is any issue, please use the latest version from Synapse

            People

            • Assignee:
              asankha Asankha C. Perera
              Reporter:
              michelemazzucco Michele Mazzucco
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development