I was changing my DSL as following

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";
        
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";>

        <bean id="constraint" 
class="org.eclipse.jetty.util.security.Constraint">
                <property name="name" value="BASIC"/>
                <property name="roles" value="admingroup"/>
                <property name="authenticate" value="true"/>
        </bean>

        <bean id="constraintMapping" 
class="org.eclipse.jetty.security.ConstraintMapping">
                <property name="constraint" ref="constraint"/>
                <property name="pathSpec" value="/*"/>
        </bean>

        <bean id="securityHandler" 
class="org.eclipse.jetty.security.ConstraintSecurityHandler">
                <property name="authenticator">
                        <bean 
class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
                </property>
                <property name="constraintMappings">
                        <list>
                                <ref component-id="constraintMapping"/>
                        </list>
                </property>
        </bean>

        <camelContext id="WEBISP001" 
xmlns="http://camel.apache.org/schema/blueprint";>

                <route id="WEBISP001">
                        <from 
uri="jetty:http://0.0.0.0:8182/hello?handlers=securityHandler"; />
                        <log message="hello request body: ${in.body}" />
                </route>

        </camelContext>
 </blueprint>

Seems that the class

org.eclipse.jetty.util.security.Constraint

has been replaced with

org.eclipse.jetty.util.security.Constraint

in Jetty9. Now I'm getting an error

org.osgi.service.blueprint.container.ComponentDefinitionException: Error 
setting property: PropertyDescriptor <name: roles, getter: class 
org.eclipse.jetty.util.security.Constraint.getRoles(), setter: [class 
org.eclipse.jetty.util.security.Constraint.setRoles(class [Ljava.lang.String;)]
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:818)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:784)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:765)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:699)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) 
~[!/:1.10.2]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
~[?:1.8.0_242]
        at 
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) 
~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:737)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:433)
 [!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298)
 [!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:311)
 [!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:280)
 [!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)
 [!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:266)
 [!/:1.10.2]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
 [!/:1.10.2]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
 [!/:1.10.2]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
 [!/:1.10.2]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
 [!/:1.10.2]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
 [!/:1.10.2]
        at 
org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)
 [org.apache.felix.framework-5.6.12.jar:?]
        at 
org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730)
 [org.apache.felix.framework-5.6.12.jar:?]
        at 
org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485)
 [org.apache.felix.framework-5.6.12.jar:?]
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) 
[org.apache.felix.framework-5.6.12.jar:?]
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) 
[org.apache.felix.framework-5.6.12.jar:?]
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) 
[org.apache.felix.framework-5.6.12.jar:?]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260)
 [!/:3.6.4]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233)
 [!/:3.6.4]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221)
 [!/:3.6.4]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515)
 [!/:3.6.4]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
 [!/:3.6.4]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)
 [!/:3.6.4]
Caused by: java.lang.Exception: Unable to convert value admingroup to type 
class [Ljava.lang.String;. Type class [Ljava.lang.String; is an interface or an 
abstract class
        at 
org.apache.aries.blueprint.container.AggregateConverter.createObject(AggregateConverter.java:313)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.AggregateConverter.convertFromString(AggregateConverter.java:307)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:177)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BlueprintRepository.convert(BlueprintRepository.java:516)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.convert(ReflectionUtils.java:434)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:668)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:418)
 ~[!/:1.10.2]
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:816)
 ~[!/:1.10.2]

Any further idea about?

> Jean-Baptiste Onofre <j...@nanthrax.net> hat am 5. April 2020 06:58 
> geschrieben:
> 
>  
> Hi
> 
> I guess the documentation is not aligned with jetty version actually used. 
> You are using Karaf 4.2.8 ?
> 
> Camel jetty feature uses the jetty version provided by pax-web/karaf, so the 
> documentation is not maybe correct for 9.4.22/27.
> 
> Regards 
> JB
> 
> > Le 4 avr. 2020 à 10:08, Gerald Kallas <catsh...@mailbox.org> a écrit :
> > 
> > Dear community,
> > 
> > I've configured a route as following snippet (following the documentation 
> > https://camel.apache.org/components/latest/jetty-component.html)
> > 
> > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >     xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
> >     https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";
> >     
> > xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";>
> > 
> >     <bean id="constraint" 
> > class="org.eclipse.jetty.http.security.Constraint">
> >             <property name="name" value="BASIC"/>
> >             <property name="roles" value="admin"/>
> >             <property name="authenticate" value="true"/>
> >     </bean>
> > 
> >     <bean id="constraintMapping" 
> > class="org.eclipse.jetty.security.ConstraintMapping">
> >             <property name="constraint" ref="constraint"/>
> >             <property name="pathSpec" value="/*"/>
> >     </bean>
> > 
> >     <bean id="securityHandler" 
> > class="org.eclipse.jetty.security.ConstraintSecurityHandler">
> >             <property name="authenticator">
> >                     <bean 
> > class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
> >             </property>
> >             <property name="constraintMappings">
> >                     <list>
> >                             <ref bean="constraintMapping"/>
> >                     </list>
> >             </property>
> >     </bean>
> > 
> >     <camelContext id="WEBISP001" 
> > xmlns="http://camel.apache.org/schema/blueprint?handlers=securityHandler";>
> > 
> >             <route id="WEBISP001">
> >                     <from uri="jetty:http://0.0.0.0:8182/hello"; />
> >                     <log message="hello request body: ${in.body}" />
> >             </route>
> > 
> >     </camelContext>
> > </blueprint>
> > 
> > First of all I got
> > 
> > Unresolved requirements: [[WEBISP001.xml [264](R 264.12)] 
> > osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.http.security)]
> > 
> > Seems also that the construct
> > 
> >             <property name="constraintMappings">
> >                     <list>
> >                             <ref bean="constraintMapping"/>
> >                     </list>
> >             </property>
> > 
> > is wrong and has been changed from the syntax part.
> > 
> > Could someone post a valid example for this? And .. how to resolve the 
> > missing bundle?
> > 
> > Thanks in advance
> > Gerald

Reply via email to