karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "er.honey2012@gmail.com" <er.honey2...@gmail.com>
Subject Securing Apache CXF & Apache Camel
Date Wed, 02 Apr 2014 06:09:29 GMT
Hi,

I'm having a problem securing a CXF-JAXRS WebService using CXF filters. I am
using karaf-3.0.0 and CXF-2.7.8. I'm getting a ComponentDefinitionException: 

org.osgi.service.blueprint.container.ComponentDefinitionException: Element
ref must have a valid component-id attribute
	at org.apache.aries.blueprint.parser.Parser.parseRef(Parser.java:1217)
	at
org.apache.aries.blueprint.parser.Parser.parseValueGroup(Parser.java:1183)
	at
org.apache.aries.blueprint.parser.Parser.parseCollection(Parser.java:740)
        at
org.apache.aries.blueprint.parser.Parser.parseElement(Parser.java:363)
	at
org.apache.aries.blueprint.parser.ParserContextImpl.parseElement(ParserContextImpl.java:69)
	at
org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser.parseListData(AbstractBPBeanDefinitionParser.java:84)
	at
org.apache.camel.component.cxf.blueprint.RsServerDefinitionParser.parse(RsServerDefinitionParser.java:75)
	at
org.apache.camel.component.cxf.blueprint.CxfNamespaceHandler.parse(CxfNamespaceHandler.java:62)
        at Proxy58432c43_ae3f_4b06_b000_2bc779459eb3.parse(Unknown Source)
	at
org.apache.aries.blueprint.parser.Parser.parseCustomElement(Parser.java:1279)
	at org.apache.aries.blueprint.parser.Parser.loadComponents(Parser.java:337)
	at org.apache.aries.blueprint.parser.Parser.populate(Parser.java:277)
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:323)
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
	at
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)
	at
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)
	at
org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
	at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
	at
org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)
	at
org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)
	at
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)
	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403)
	at org.apache.felix.framework.Felix.activateBundle(Felix.java:2136)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
	at org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:48)
	at
org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:50)
	at
org.apache.karaf.bundle.command.BundlesCommandWithConfirmation.doExecute(BundlesCommandWithConfirmation.java:41)
	at
org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)
	at
org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)
	at
org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_38]
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_38]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_38]
	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_38]
	at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
	at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
	at
org.apache.karaf.shell.console.commands.$BlueprintCommand455815039.execute(Unknown
Source)[47:org.apache.karaf.shell.console:3.0.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_38]
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_38]
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_38]
	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_38]
	at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)
	at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)
	at
org.apache.karaf.shell.console.commands.$BlueprintCommand455815039.execute(Unknown
Source)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
	at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:497)
	at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:198)
	at java.lang.Thread.run(Thread.java:662)[:1.6.0_38]
	at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:118)[47:org.apache.karaf.shell.console:3.0.0]
	at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:109)
	at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_38]
	at
org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[48:org.apache.karaf.jaas.modules:3.0.0]
	at
org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:107)[47:org.apache.karaf.shell.console:3.0.0]



This is my blueprint

<?xml version="1.0" encoding="UTF-8"?>
<blueprint  
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
        xmlns:camel="http://camel.apache.org/schema/blueprint"
        xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
       
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
        xsi:schemaLocation="
		http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
		http://camel.apache.org/schema/blueprint/cxf
http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd
		http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd" >
	
    <cm:property-placeholder persistent-id="com.xxxx.cp.securitytoken">
        <cm:default-properties>
            <cm:property name="server.api.url"
value="http://localhost:80/v1" />
        </cm:default-properties>
    </cm:property-placeholder>

   <cxf:rsServer id="rsServer" address="/security"
serviceClass="com.xxxx.cp.securitytoken.SecurityTokenServiceImpl">
	<cxf:providers>
       		<ref bean="authorizationFilter"/>
    	</cxf:providers>
   </cxf:rsServer>
   
   <bean id="authorizationFilter"
class="org.apache.cxf.jaxrs.security.JAASAuthenticationFilter">
	  <property name="contextName" value="myRealm"/>
    </bean>
   
	<camelContext xmlns="http://camel.apache.org/schema/blueprint"
id="security">
		<route>
			<from uri="cxfrs://bean://rsServer"/>
			<to uri="{{server.api.url}}?bridgeEndpoint=true" />
		</route>
	</camelContext>

</blueprint>

I tried several examples on the web, no luck. Am i doing wrong? suggestions?

Thanks,
Honey Goyal



--
View this message in context: http://karaf.922171.n3.nabble.com/Securing-Apache-CXF-Apache-Camel-tp4032525.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Mime
View raw message