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

camel-servlet - Issue with REST Service after Camel update - custom servletName does not work

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

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.11.2
    • 3.11.3, 3.13.0, 3.7.7
    • rest
    • None
    • Unknown

    Description

      After updating from Camel 3.4.4 to 3.11.2 our REST Services aren'T working anymore.

      Already discussed here: https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/Problem.20with.20REST.20services.20after.20upgrading.20to.20Camel.203.2E11.2E2/near/255227937

      Debugging revealed the following:

      we create a Osgi Camel Context and register Routes like this:

      camelContext = new OsgiDefaultCamelContext(bundleContext) {
      				@Override
      				public void init() {
      					final RouteBuilder routes = createRoutes();
      					routes.restConfiguration().componentProperty("servletName", "my.custom.servletName").clientRequestValidation(true);
      					this.addRoutes(routes);
      					super.init();
      				}
       

       
      In org.apache.camel.component.servlet.ServletComponent.connect(HttpConsumer)

      sc.getEndpoint().getServletName()
      

      returns the Default Servlet Name

      CamelServlet

      and not my

      my.custom.servletName

      because

      org.apache.camel.component.servlet.ServletEndpoint.setServletName(String)

      is called with

      CamelServlet

      and not with my custom servletname.

      Seems like no one is setting the correct value on

      org.apache.camel.component.servlet.ServletComponent.setServletName(String)

      Attachments

        Activity

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

          People

            davsclaus Claus Ibsen
            phermsdorf Peter Hermsdorf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment