karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristiano Gavião <cvgav...@gmail.com>
Subject Re: Setup a List property with Blueprint and Configuration Admin ?
Date Mon, 02 May 2011 22:56:25 GMT
Hi Johan,

Thanks, but I don't think your way could help me in my case because I 
don't think that I could dynamically increase my list of strings that 
comes from a config file on ${karaf}/etc.

cheers

Cristiano

On 02/05/11 19:04, Johan Edstrom wrote:
> <property name="baseUrls">
>        <list>
>          <value>${wcs.soap.httpEndpoint}</value>
>          <value>${wcs.subscribe.httpEndpoint}</value>
>          <value>${wcs.mngSubscription.httpEndpoint}</value>
>
>          <value>${wcs.kvp.httpEndpoint}</value>
>        </list>
>
> On May 2, 2011, at 3:46 PM, Cristiano Gavião wrote:
>
>> Hi,
>>
>> I'm setting up my service using blueprint and CM. I could make it work properly for
single properties.
>> But now I can't figure out how to configure CM for a property that is a List<String>.
>>> <cm:property-placeholder persistent-id="myservice.osgi"
>>>         update-strategy="reload">
>>> <cm:default-properties>
>>> <cm:property name="annotatedEmbedderRunnerClass"
>>>                 value="core.AnnotatedEmbedderRunner" />
>>> </cm:default-properties>
>>> </cm:property-placeholder>
>> * without CM, includeList is created properly by blueprint using ArrayList class:
>>> <bean id="embedderServiceImpl" class="test.EmbedderServiceImpl"
>>>         init-method="startUp" destroy-method="stop">
>>> <property name="includeList">
>>> <list>
>>> <value>teste</value>
>>> </list>
>>> </property>
>>> <property name="annotatedEmbedderRunnerClass" value="${annotatedEmbedderRunnerClass}"
/>
>>> </bean>
>> I've tried to do this, but didn't work:
>>> <cm:property name="includeList">
>>> <list>
>>> <value>test</value>
>>> </list>
>>> </cm:property>
>> ...
>>> <property name="includeList" value= ${includeList}>
>> This is the error reported on karaf log:
>>> Caused by: java.lang.Exception: Unable to convert value [test] to type interface
java.util.List. Type interface java.util.List is an interface or an abstract class
>>
>> Could someone point me the way to setup this List using CM?
>>
>> thanks and regards
>>
>> Cristiano


Mime
View raw message