Something interesting happened. When preparing an isolated blueprint.xml to
post it here, I removed a lot of other stuff I had, reducing the XML to a bare
minimum, and it now works!
So, something else in the XML is conflicting, I don’t know what, but I will now
add things one at a time, until I figure out what is causing it. I will post
here my findings.
In any case, this is the reduced XML, which have the same name spaces as the
full version that didn’t work.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.3.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.5.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<!-- need this to get system variables i.e. ${user.home} -->
<ext:property-placeholder placeholder-prefix="#["
placeholder-suffix="]" />
<cm:property-placeholder persistent-id="my.config.id"
update-strategy="reload" placeholder-prefix="#{" placeholder-suffix="}">
<cm:default-properties>
<cm:property name="my.file.name"
value="#[user.home]/.other/somefile" />
</cm:default-properties>
</cm:property-placeholder>
<bean id="fileReader" class="org.FileReader">
<argument value="#{my.file.name}" />
</bean>
</blueprint>
Thank you,
Alex soto
[email protected]
> On Sep 2, 2016, at 9:28 AM, Jean-Baptiste Onofré <[email protected]> wrote:
>
> Do you use both cm and ext namespaces or only ext ?
>
> Can you share your blueprint.xml ?
>
> Thanks,
> Regards
> JB
>
> On 09/02/2016 03:21 PM, Alex Soto wrote:
>> Same issue if run as standalone, I even tested adding a cfg file with the
>> configuration entry, but the bundle fails to start and the value in the
>> configuration file does not seem to be honored.
>>
>> Best regards,
>> Alex soto
>>
>>
>>
>>> On Sep 2, 2016, at 8:59 AM, Jean-Baptiste Onofré <[email protected]> wrote:
>>>
>>> Do you have the issue only in Pax Exam or in Karaf standalone container as
>>> well ?
>>>
>>> I just tried with a simple blueprint and it works fine with ext and cm
>>> xmlns.
>>>
>>> Regards
>>> JB
>>>
>>> On 09/02/2016 02:49 PM, Alex Soto wrote:
>>>> Hi JB,
>>>>
>>>> Yes, I saw that other thread, but it is still not working for me. I
>>>> printed the user.home value in the activation method of some other DS
>>>> component, and is it correctly set to the user home directory. It only
>>>> does not work when referenced in a Blueprint XML. I don’t know if I
>>>> have the correct versions, or perhaps I am missing a feature. From the
>>>> Karaf/Pax-Exam log I can see the following features being loaded.
>>>>
>>>> mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.1
>>>> mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.0.7
>>>> mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.4.5
>>>>
>>>> mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0
>>>> mvn:org.apache.aries.jmx/org.apache.aries.jmx.api/1.1.5
>>>> mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint.api/1.1.5
>>>> mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint.core/1.1.5
>>>> mvn:org.apache.aries.jmx/org.apache.aries.jmx.core/1.1.5
>>>> mvn:org.apache.aries.jmx/org.apache.aries.jmx.whiteboard/1.1.5
>>>> mvn:org.apache.aries.proxy/org.apache.aries.proxy.api/1.0.1
>>>> mvn:org.apache.aries.proxy/org.apache.aries.proxy.impl/1.0.4
>>>> mvn:org.apache.aries/org.apache.aries.util/1.1.1
>>>> mvn:org.apache.camel/camel-blueprint/2.17.0
>>>> mvn:org.apache.felix/org.apache.felix.scr/2.0.2
>>>> mvn:org.apache.felix/org.apache.felix.scr.compat/1.0.2
>>>> mvn:org.apache.karaf.scr/org.apache.karaf.scr.command/4.0.3
>>>> mvn:org.apache.karaf.scr/org.apache.karaf.scr.management/4.0.3
>>>>
>>>>
>>>> Does it look correct to you?
>>>>
>>>> Also, I see a strange message:
>>>>
>>>> 2016-09-02 08:32:22,218 | INFO | pool-10-thread-1
>>>> | BlueprintExtender
>>>> | org.apache.aries.blueprint.core | No quiesce support is available,
>>>> so blueprint components will not participate in quiesce operations
>>>>
>>>> Not sure what that means.
>>>>
>>>> Thank you, and best regards,
>>>> Alex soto
>>>>
>>>>
>>>>
>>>>> On Sep 2, 2016, at 1:28 AM, Jean-Baptiste Onofré <[email protected]
>>>>> <mailto:[email protected]>> wrote:
>>>>>
>>>>> Hi Alex,
>>>>>
>>>>> I answered to another user couple of days ago with the same question
>>>>> (system property in blueprint) and he said it works fine.
>>>>>
>>>>> Can you check the actual value of user.home ?
>>>>>
>>>>> I will try by my side.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 09/01/2016 07:45 PM, Alex Soto wrote:
>>>>>> Hello, I have a blueprint bundle defined as:
>>>>>>
>>>>>> <blueprint
>>>>>> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
>>>>>> xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
>>>>>> xsi:schemaLocation="
>>>>>> http://www.osgi.org/xmlns/blueprint/v1.0.0
>>>>>>
>>>>>> https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>>>>>>
>>>>>> <ext:property-placeholder placeholder-prefix="$["
>>>>>> placeholder-suffix="]" />
>>>>>>
>>>>>> <cm:property-placeholder persistent-id="my.config.id"
>>>>>> update-strategy="reload" placeholder-prefix="#{"
>>>>>> placeholder-suffix="}">
>>>>>> <cm:default-properties>
>>>>>> <cm:property name="my.file.name"
>>>>>> value="$[user.home]/.other/somefile" />
>>>>>> </cm:default-properties>
>>>>>> </cm:property-placeholder>
>>>>>> <bean id=“fileReader" class="org.FileReader">
>>>>>> <argument value="#{my.file.name}" />
>>>>>> </bean>
>>>>>>
>>>>>>
>>>>>>
>>>>>> The $[user.home] place holder is never substituted , so I get file not
>>>>>> found error on file name "$[user.home]/.other/somefile"
>>>>>> I have search everywhere but I can’t figure out what I am doing wrong.
>>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> [email protected]
>>>>>> <mailto:[email protected]> <mailto:[email protected]>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> [email protected] <mailto:[email protected]>
>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> [email protected]
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com