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

ClassCastException with interceptFrom

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.16.2
    • 2.16.3, 2.17.0
    • camel-core, jmx
    • None
    • Patch Available
    • Unknown

    Description

      If a statement like

      interceptFrom().when(simple("${header.foo} == 'bar'")).to("mock:intercepted");
      

      is available in a route builder with JMX enabled the startup will fail in Camel 2.16.2 (and the current 2.17-SNAPSHOT) with a ClassCastException in line 310 of DefaultManagementObjectStrategy.

      The generated processor is a FilterProcessor, but the resulting definition is a WhenDefinition not a FilterDefinition.

      The reason is that CAMEL-8992 introduced a too precise class check for this.

      The attached patch relexes the class constraint on the definition.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            siano Stephan Siano
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment