Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12475

Undertow consumer with http4 producer results in Undertow throwing NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.20.3, 2.21.0
    • 2.20.4, 2.21.2, 2.22.0
    • None
    • Operating System: Windows 8

      Java version: 1.8

      Camel version: 2.21.0

    • Unknown

    Description

      I have a very simple setup of Camel (standalone).

      My route is as follows:

      public class Application {
          public static void main(String... args) throws Exception {
              Main main = new Main();
      
              main.addRouteBuilder(new RouteBuilder() {
                  @Override
                  public void configure() throws Exception {
                      restConfiguration().port(8080);
      
                      rest("/pi")
                              .get()
                              .route()
                              .setExchangePattern(ExchangePattern.InOut)
                              .to("https4://api.pi.delivery/v1/pi?bridgeEndpoint=true");
                  }
              });
      
              main.run();
          }
      }

      Call the endpoint with: 

      curl "http://localhost:8080/pi?start=0&numberOfDigits=10"

       

      When using camel-undertow for consumer and camel-http4 for producer, I get a NullPointerException.

      java.lang.NullPointerException: null
      at io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:141) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final]
      at io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:285) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final]
      at org.apache.camel.component.undertow.UndertowConsumer.handleRequest(UndertowConsumer.java:142) ~[camel-undertow-2.21.0.jar:2.21.0]
      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final]
      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) ~[undertow-core-1.4.23.Final.jar:1.4.23.Final]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_102]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_102]
      at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_102]
      

      However, if I switch out the camel-undertow dependency with camel-jetty, the above route configuration works just fine.

      Attachments

        Activity

          People

            njiang Willem Jiang
            dentych Dennis Tychsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: