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

intercept with stop and predicate causes NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.4.0
    • 1.4.0
    • camel-core
    • None

    Description

      I am working to improve the intercept DSL documentation and the new stop() type

      This code fails with a NPE

          public void testInterceptor() throws Exception {
              MockEndpoint mockOk = getMockEndpoint("mock:ok");
              mockOk.expectedBodiesReceived("Camel in Action");
      
              template.sendBodyAndHeader("direct:order", "Camel in Action", "user", "James");
      
              mockOk.assertIsSatisfied();
          }
      
          protected RouteBuilder createRouteBuilder() throws Exception {
              return new RouteBuilder() {
                  public void configure() throws Exception {
                      intercept(header("user").isEqualTo("test")).to("mock:test").stop();
      
                      from("direct:order").to("mock:ok");
                  }
              };
          }
      
      
      java.lang.NullPointerException
      	at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:48)
      	at org.apache.camel.processor.Interceptor.process(Interceptor.java:41)
      	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
      	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:155)
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: