Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: fuse-7.0.1
    • Fix Version/s: fuse-7.2, fuse-7.3
    • Component/s: Camel, Fuse Distribution
    • Labels:
      None
    • Environment:
      • fuse-karaf-7.0.0.fuse-000191-redhat-1
    • Sprint:
      Fuse 7.3 Sprint 40 - Dev #1
    • Steps to Reproduce:
      Hide

      1- Unzip fuse-karaf-7.0.0.fuse-000191-redhat-1 distribution.
      2- Install the camel-servlet feature.
      3- Put the servlet-service.xml file in the deploy folder.
      4- Put the camel-route.xml file in the deploy folder.
      5- Check the console output.

      Show
      1- Unzip fuse-karaf-7.0.0.fuse-000191-redhat-1 distribution. 2- Install the camel-servlet feature. 3- Put the servlet-service.xml file in the deploy folder. 4- Put the camel-route.xml file in the deploy folder. 5- Check the console output.

      Description

      Trying to expose a camel-servlet endpoint as OSGi service (interface org.apache.camel.http.common.CamelServlet) made it in Camel 2.17.X is not possible in Camel 2.21.0. After artifact deployment the following exception is displayed:

      Caused by: org.apache.aries.proxy.FinalModifierException: The methods protected final void org.apache.camel.http.common.CamelServlet.service(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException in class org.apache.camel.http.common.CamelServlet are final.
              at org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.getProxySubclass(ProxySubclassGenerator.java:112) ~[?:?]
              at org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.newProxySubclassInstance(ProxySubclassGenerator.java:171) ~[?:?]
              at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:140) ~[?:?]
              at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:77) ~[?:?]
              at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingProxy(AbstractProxyManager.java:42) ~[?:?]
              at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:332) ~[?:?]
              at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:125) ~[?:?]
              ... 38 more
      

      After some research seems that since Camel release 2.18 the camel method "service" is "final" https://github.com/apache/camel/blob/master/components/camel-http-common/src/main/java/org/apache/camel/http/common/CamelServlet.java#L74.

      Changing from org.apache.camel.http.common.CamelServlet to javax.servlet.Servlet does not works neither as per DefaultHttpRegistry class requires the CamelServlet class in the "register" method https://github.com/apache/camel/blob/master/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/DefaultHttpRegistry.java#L97.

      How should be deployed the camel-servlet component as an OSGi service in Camel 2.21?

        Gliffy Diagrams

          Attachments

          1. camel-route.xml
            2 kB
          2. camel-route-2.xml
            2 kB
          3. deploy.tar.gz
            1 kB
          4. servlet-service.xml
            0.6 kB

            Activity

              People

              • Assignee:
                tadayosi Tadayoshi Sato
                Reporter:
                emunoz Elkin Munoz
                Tester:
                Tomas Turek
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: