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

camel-servlet - Example for HttpRegistry no longer works throwing FinalModifierException

    XMLWordPrintableJSON

    Details

    • Estimated Complexity:
      Unknown

      Description

      There was a configuration example for HttpRegistry, which is introduced by CAMEL-3549, under tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/servlet/. The test itself was removed probably because it depended on deprecated Spring DM, but the use case CAMEL-3549, which is to use a CamelServlet instance across OSGi bundles, exemplified by the test should be still valid and maintained.

      However, with the latest Camel when deploying the attached example (camel-example-servlet-httpregistry-blueprint.zip) to Karaf it fails to deploy throwing the following error:

      2018-10-09T20:42:54,813 | ERROR | FelixStartLevel  | BlueprintContainerImpl           | 52 - org.apache.aries.blueprint.core - 1.9.0 | Unable to start blueprint container for bundle camel-example-servlet-httpregistry-blueprint/2.23.0.SNAPSHOT
      org.osgi.service.blueprint.container.ComponentDefinitionException: 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.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:141) ~[52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) ~[52:org.apache.aries.blueprint.core:1.9.0]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
      	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) ~[52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360) ~[52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190) ~[52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:716) ~[52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:413) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:299) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:268) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:264) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:254) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) [52:org.apache.aries.blueprint.core:1.9.0]
      	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) [?:?]
      	at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) [?:?]
      	at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) [?:?]
      	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) [?:?]
      	at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) [?:?]
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1373) [?:?]
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) [?:?]
      	at java.lang.Thread.run(Thread.java:748) [?:?]
      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) ~[?:?]
      	... 25 more
      

      This is clearly because at some point in time CamelServlet.service() method was marked as final. We should remove it to restore the use case.

        Attachments

          Activity

            People

            • Assignee:
              tadayosi Tadayoshi Sato
              Reporter:
              tadayosi Tadayoshi Sato
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: