camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franz Paul Forsthofer <emc2...@googlemail.com>
Subject Re: camel-xmlsecurity - Not able to set KeyAccessor
Date Mon, 16 Sep 2013 09:54:57 GMT
ello,

does the class com.airtel.money.camel_xmlsecurity.api.DefaultKeyAccessor
implement the interface
org.apache.camel.component.xmlsecurity.api.KeyAccessor? I am asking because
the bean used in the parameter 'keyAccessor' of the xmlsecurity component
must be of type org.apache.camel.component.xmlsecurity.api.KeyAccessor.

Regards Franz


On Fri, Sep 13, 2013 at 8:58 PM, lmanchanda75 <lmanchanda75@gmail.com>wrote:

>  Hi,
>
> I am trying to use xmlsecurity component, but while trying to set the
> keyAccessor I get classCast exception as detailed in the error below.
>
> Please see what can I correct.
>
>
> Following is the bean definition in camel-context blueprint
>
> <bean id="defaultAccessor" class="manchanda.lalit.TestStream.TestKeystore"
> factory-method="getKeyAccessor">
>         <argument value="public" />
> </bean>
>
>
>
> Following is the route defined in camel-context blueprint
>
> <route id="recon-route">
>                  <from uri="timer:checkCreate?period=50s" />
>                  <bean ref="helloBean" method="setXmlBody"/>
>                  <to
>
> uri="xmlsecurity:sign://enveloped?keyAccessor=#defaultAccessor&amp;parentLocalName=root&amp;parentNamespace=
> http://test/test"
> />
>          <to uri="mock:result"/>
>     </route>
>
>
>
> Following is the code to get the KeyAccessor
>
>
> public static KeyAccessor getKeyAccessor(String alias) throws Exception {
>
>         DefaultKeyAccessor accessor = new DefaultKeyAccessor();
>         accessor.setKeyStore(getKeyStore());
>         accessor.setPassword(getPassword());
>         accessor.setAlias(alias);
>         return accessor;
>     }
>
>
>
> Following are the logs showing the issuse
>
>
> 23:39:23,282 | DEBUG | m-0.1.0-thread-1 | BlueprintContainerImpl
> |
> 14 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Instantiating
> component defaultAccessor
> 23:39:23,282 | ERROR | m-0.1.0-thread-1 | BlueprintCamelContext
>  |
> 1350 - org.apache.camel.camel-blueprint - 2.10.0.redhat-60024 | Error
> occurred during starting Camel: CamelContext(blueprintContext) due Failed
> to
> create route recon-route at: >>>
>
> To[xmlsecurity:sign://enveloped?keyAccessor=#defaultAccessor&parentLocalName=root&parentNamespace=
> http://test/test]
> <<< in route: Route[[From[timer:checkCreate?period=50s]] ->
> [Bean[ref:hell... because of Failed to resolve endpoint:
>
> xmlsecurity://sign://enveloped?keyAccessor=%23defaultAccessor&parentLocalName=root&parentNamespace=http%3A%2F%2Ftest%2Ftest
> due to: Found bean: defaultAccessor in BlueprintContainer:
> org.apache.aries.blueprint.container.BlueprintContainerImpl@1a0cbb2 of
> type:
> com.airtel.money.camel_xmlsecurity.api.DefaultKeyAccessor expected type
> was:
> interface com.airtel.money.camel_xmlsecurity.api.KeyAccessor
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> recon-route at: >>>
>
> To[xmlsecurity:sign://enveloped?keyAccessor=#defaultAccessor&parentLocalName=root&parentNamespace=
> http://test/test]
> <<< in route: Route[[From[timer:checkCreate?period=50s]] ->
> [Bean[ref:hell... because of Failed to resolve endpoint:
>
> xmlsecurity://sign://enveloped?keyAccessor=%23defaultAccessor&parentLocalName=root&parentNamespace=http%3A%2F%2Ftest%2Ftest
> due to: Found bean: defaultAccessor in BlueprintContainer:
> org.apache.aries.blueprint.container.BlueprintContainerImpl@1a0cbb2 of
> type:
> com.airtel.money.camel_xmlsecurity.api.DefaultKeyAccessor expected type
> was:
> interface com.airtel.money.camel_xmlsecurity.api.KeyAccessor
>         at
>
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:731)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1803)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1589)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1453)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1421)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:161)[1350:org.apache.camel.camel-blueprint:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:128)[1350:org.apache.camel.camel-blueprint:2.10.0.redhat-60024]
>         at
>
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:934)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:795)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4596)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.Felix.registerService(Felix.java:3604)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:439)[14:org.apache.aries.blueprint.core:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:379)[14:org.apache.aries.blueprint.core:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)[14:org.apache.aries.blueprint.core:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:270)[14:org.apache.aries.blueprint.core:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:233)[14:org.apache.aries.blueprint.core:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[13:org.apache.aries.util:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[13:org.apache.aries.util:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[13:org.apache.aries.util:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[13:org.apache.aries.util:1.0.1.redhat-60024]
>         at
>
> org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[13:org.apache.aries.util:1.0.1.redhat-60024]
>         at
>
> org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4580)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.Felix$4.run(Felix.java:2115)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> org.apache.felix.framework.Felix$5.run(Felix.java:2159)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
>         at
>
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)[:1.6.0_43]
>         at
>
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_43]
>         at
> java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_43]
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)[:1.6.0_43]
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)[:1.6.0_43]
>         at java.lang.Thread.run(Thread.java:662)[:1.6.0_43]
> *Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint:
>
> xmlsecurity://sign://enveloped?keyAccessor=%23defaultAccessor&parentLocalName=root&parentNamespace=http%3A%2F%2Ftest%2Ftest
> due to: Found bean: defaultAccessor in BlueprintContainer:
> org.apache.aries.blueprint.container.BlueprintContainerImpl@1a0cbb2 of
> type:
> com.airtel.money.camel_xmlsecurity.api.DefaultKeyAccessor expected type
> was:
> interface com.airtel.money.camel_xmlsecurity.api.KeyAccessor*
>         at
>
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:488)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:61)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:876)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         ... 37 more
> Caused by: org.apache.camel.NoSuchBeanException: Found bean:
> defaultAccessor
> in BlueprintContainer:
> org.apache.aries.blueprint.container.BlueprintContainerImpl@1a0cbb2 of
> type:
> com.airtel.money.camel_xmlsecurity.api.DefaultKeyAccessor expected type
> was:
> interface com.airtel.money.camel_xmlsecurity.api.KeyAccessor
>         at
>
> org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:66)[1350:org.apache.camel.camel-blueprint:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:51)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:62)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:119)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:369)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.util.EndpointHelper.setReferenceProperties(EndpointHelper.java:272)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:221)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> com.airtel.money.camel_xmlsecurity.XmlSignatureComponent.createEndpoint(XmlSignatureComponent.java:77)[1412:com.airtel.money.camel-xmlsecurity:0.1]
>         at
>
> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         at
>
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:469)[130:org.apache.camel.camel-core:2.10.0.redhat-60024]
>         ... 46 more
> Caused by: java.lang.ClassCastException
>         at java.lang.Class.cast(Class.java:2999)[:1.6.0_43]
>         at
>
> org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:62)[1350:org.apache.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-xmlsecurity-Not-able-to-set-KeyAccessor-tp5739339.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message