Camel
  1. Camel
  2. CAMEL-3201

The CxfConsumer's getContinuation method might throw NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.5.0
    • Component/s: camel-cxf
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Regression:
      Regression

      Description

      Hello

      When trying the latest CAMEL 2.5.0 SNAPSHOT, I got a NPE:

      java.lang.NullPointerException
             at org.apache.camel.component.cxf.CxfConsumer$1.getContinuation(CxfConsumer.java:129)
             at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:65)
             at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      ...
      
      1. CAMEL-3201.patch
        0.9 kB
        S. Ali Tokmen

        Activity

        Hide
        S. Ali Tokmen added a comment -

        Attaching patch

        Show
        S. Ali Tokmen added a comment - Attaching patch
        Hide
        Hadrian Zbarcea added a comment -

        Thanks for reporting this and for the patch. If provider is null, what happens?
        Did you intend something like below?

        return provider == null ? null : provider.getContinuation();
        
        Show
        Hadrian Zbarcea added a comment - Thanks for reporting this and for the patch. If provider is null, what happens? Did you intend something like below? return provider == null ? null : provider.getContinuation();
        Hide
        S. Ali Tokmen added a comment -

        Hello

        Yes, indeed I had meant your version

        The return being null is already checked by the caller, here is a snippet:

                        Continuation continuation = getContinuation(cxfExchange);
                        if (continuation != null && !endpoint.isSynchronous()) {
                            return asyncInvoke(cxfExchange, continuation);
                        } else {
                            return syncInvoke(cxfExchange);
                        }
        
        Show
        S. Ali Tokmen added a comment - Hello Yes, indeed I had meant your version The return being null is already checked by the caller, here is a snippet: Continuation continuation = getContinuation(cxfExchange); if (continuation != null && !endpoint.isSynchronous()) { return asyncInvoke(cxfExchange, continuation); } else { return syncInvoke(cxfExchange); }
        Hide
        Hadrian Zbarcea added a comment -

        Thanks Savas, I'll apply the patch, you still get the credit .

        Show
        Hadrian Zbarcea added a comment - Thanks Savas, I'll apply the patch, you still get the credit .
        Hide
        Claus Ibsen added a comment -

        Hadrian get in touch with willem as he knows this CXF continuation stuff and have worked on this.

        Show
        Claus Ibsen added a comment - Hadrian get in touch with willem as he knows this CXF continuation stuff and have worked on this.
        Hide
        Willem Jiang added a comment -

        @Hadrian

        I'm OK with the patch, please apply it.

        Show
        Willem Jiang added a comment - @Hadrian I'm OK with the patch, please apply it.
        Hide
        Willem Jiang added a comment -

        If you are using cxf-rt-http-jetty-transport or cxf-rt-jms-transport, there is always a ContinuationProvider, but if you are using other transport, you will get the NPE.

        Show
        Willem Jiang added a comment - If you are using cxf-rt-http-jetty-transport or cxf-rt-jms-transport, there is always a ContinuationProvider, but if you are using other transport, you will get the NPE.
        Hide
        Hadrian Zbarcea added a comment -

        Patch applied with thanks to Savas (rev: 1005334). Keep them coming.

        Show
        Hadrian Zbarcea added a comment - Patch applied with thanks to Savas (rev: 1005334). Keep them coming.
        Hide
        S. Ali Tokmen added a comment -

        Excellent

        Indeed, I'm using the HTTP transport without Jetty, hence the NPE as Willem explained

        Cheers

        Show
        S. Ali Tokmen added a comment - Excellent Indeed, I'm using the HTTP transport without Jetty, hence the NPE as Willem explained Cheers
        Hide
        Claus Ibsen added a comment -

        Closing all resolved tickets from 2010 or older

        Show
        Claus Ibsen added a comment - Closing all resolved tickets from 2010 or older

          People

          • Assignee:
            Hadrian Zbarcea
            Reporter:
            S. Ali Tokmen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development