0 Replies Latest reply on Nov 24, 2014 9:41 PM by Stuart Winchester

    blueprint - using a custom ExchangeFormatter on fuse 6.1.0.redhat-379

    Stuart Winchester Newbie

      Hi all,


      I hope someone can help me on this one.  I am trying to use my own ExchangeFormatter for logging on fuse and I can't get it to work .  I have started by creating a class called MyExchangeFormatter which is a direct copy of the camel DefaultExchangeFormatter.  When adding this to blueprint as follows:

       

      <bean id="logFormatter" class="org.swinchester.MyExchangeFormatter" scope="prototype" />

      ...

      <route>
        <from uri="timer://myTimer?period=5000&amp;repeatCount=2"/>
        <to uri="log:foo?showHeaders=false&amp;showBody=true"/>
        <to uri="log:bar?showHeaders=true&amp;showBody=false"/>
      </route>


      The following error occurs:


      2014-11-25 13:36:20,911 | ERROR | edhat-379/deploy | BlueprintCamelContext            | ?                                   ? | 150 - org.apache.camel.camel-blueprint - 2.12.0.redhat-610379 | Error occurred during starting Camel: CamelContext(blueprintContext) due Failed to create route route6 at: >>> To[log:bar?showHeaders=true&showBody=false] <<< in route: Route(route6)[[From[timer://myTimer?period=5000&repeatCount=... because of Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{showBody=false, showHeaders=true}]

      org.apache.camel.FailedToCreateRouteException: Failed to create route route6 at: >>> To[log:bar?showHeaders=true&showBody=false] <<< in route: Route(route6)[[From[timer://myTimer?period=5000&repeatCount=... because of Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{showBody=false, showHeaders=true}]

        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)

        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)

        at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:778)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1955)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1705)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1579)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)

        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1547)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:177)

        at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:209)

        at org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:147)

        at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:934)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:795)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4666)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.Felix.registerService(Felix.java:3674)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:347)

        at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353)

        at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:97)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_71]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_71]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_71]

        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_71]

        at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_71]

        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:676)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:374)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:270)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:233)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[11:org.apache.aries.util:1.0.1.redhat-610379]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[11:org.apache.aries.util:1.0.1.redhat-610379]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[11:org.apache.aries.util:1.0.1.redhat-610379]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[11:org.apache.aries.util:1.0.1.redhat-610379]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[11:org.apache.aries.util:1.0.1.redhat-610379]

        at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4650)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.Felix$4.run(Felix.java:2123)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.Felix.runInContext(Felix.java:2147)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.Felix.startBundle(Felix.java:2121)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]

        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[7:org.apache.felix.fileinstall:3.3.11.redhat-610379]

        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[7:org.apache.felix.fileinstall:3.3.11.redhat-610379]

        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1208)[7:org.apache.felix.fileinstall:3.3.11.redhat-610379]

        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:503)[7:org.apache.felix.fileinstall:3.3.11.redhat-610379]

        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[7:org.apache.felix.fileinstall:3.3.11.redhat-610379]

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{showBody=false, showHeaders=true}]

        at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:531)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:71)

        at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:192)

        at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)

        at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)

        at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)

        at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)

        at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)

        at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)

        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)

        ... 55 more

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: log://bar?showBody=false&showHeaders=true due to: There are 2 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{showBody=false, showHeaders=true}]

        at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:192)

        at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:137)

        at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:511)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

        ... 64 more