You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ellirael <el...@mail.ru> on 2016/08/31 13:46:49 UTC
Inject system property value via blueprint
I saw an example how to inject property values which are defined in config
file.
It is some thing like this:
<cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>
<cm:default-properties>
<cm:property name="title" value="Default Title"/>
</cm:default-properties>
</cm:property-placeholder>
<bean id="myApp" init-method="refresh">
<property name="title" value="$\{title\}"></property>
</bean>
How to do the same with the system property printed by system:property
command output?
Or how to gain access to those system properties values?
--
View this message in context: http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blueprint-tp4047779.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Inject system property value via blueprint
Posted by ellirael <el...@mail.ru>.
TY, JB. It works fine.
--
View this message in context: http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blueprint-tp4047779p4047781.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Inject system property value via blueprint
Posted by Alex Soto <al...@envieta.com>.
I put them in the setenv file, something like:
-Dhome.dir=$HOME
Best regards,
Alex soto
> On Sep 2, 2016, at 11:00 AM, CLEMENT Jean-Philippe <je...@fr.thalesgroup.com> wrote:
>
> Ok... is there a way to use env variables other than via system variables?
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Envoyé : vendredi 2 septembre 2016 16:19
> À : user@karaf.apache.org
> Objet : Re: Inject system property value via blueprint
>
> Ha, ok understood.
>
> So, it's about env variables more than system variables. System variables for me are passed using -D on the JVM.
>
> Regards
> JB
>
> On 09/02/2016 03:41 PM, CLEMENT Jean-Philippe wrote:
>> I'm not too sure it's the same need => at present time to get an environment variable in a cfg I have to modify the setenv (export KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a cfg (SOME_KEY=${my.variable}).
>>
>> But I have to "declare" each variable in the setenv scripts... Could
>> be nice to get environment variables directly, for instance
>> SOME_KEY=$[MY_ENV_VARIABLE]
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : vendredi 2
>> septembre 2016 15:29 À : user@karaf.apache.org Objet : Re: Inject
>> system property value via blueprint
>>
>> OK, it sounds like this one then:
>>
>> https://issues.apache.org/jira/browse/KARAF-4609
>>
>> Regards
>> JB
>>
>> On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
>>> Ah, I mean more environment related such as "export MY_PROPERTY=something" the use it in Karaf via something like $[MY_PROPERTY].
>>>
>>> I think we already had this discussion but I did not succeed in
>>> finding a corresponding Jira (?)
>>>
>>> Regards,
>>> JP
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : vendredi
>>> 2 septembre 2016 14:36 À : user@karaf.apache.org Objet : Re: Inject
>>> system property value via blueprint
>>>
>>> You mean to be able to use ${sys.user.home} in a cfg file where user.home is the system property ?
>>>
>>> Maybe it's related to:
>>> https://issues.apache.org/jira/browse/KARAF-4609
>>> https://issues.apache.org/jira/browse/KARAF-3949
>>>
>>> Regards
>>> JB
>>>
>>> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>>>> Hi JB,
>>>>
>>>> Does it also work for .cfg files?
>>>>
>>>> Regards,
>>>> JP
>>>>
>>>> -----Message d'origine-----
>>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : mercredi
>>>> 31 août 2016 15:49 À : user@karaf.apache.org Objet : Re: Inject
>>>> system property value via blueprint
>>>>
>>>> Hi,
>>>>
>>>> you have to use the ext xmlns for that.
>>>>
>>>> Just add the following in your blueprint:
>>>>
>>>> <!-- Allow the use of system properties -->
>>>> <ext:property-placeholder placeholder-prefix="$["
>>>> placeholder-suffix="]" />
>>>>
>>>> Then, you can use system properties with $[foo].
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 08/31/2016 03:46 PM, ellirael wrote:
>>>>> I saw an example how to inject property values which are defined in
>>>>> config file.
>>>>> It is some thing like this:
>>>>>
>>>>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>>>>
>>>>> <cm:default-properties>
>>>>> <cm:property name="title" value="Default Title"/>
>>>>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>>>>> init-method="refresh"> <property name="title"
>>>>> value="$\{title\}"></property> </bean>
>>>>>
>>>>> How to do the same with the system property printed by
>>>>> system:property command output?
>>>>> Or how to gain access to those system properties values?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-
>>>>> b l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>>>> archive at Nabble.com.
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
Re: Inject system property value via blueprint
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Let me ping Grzegorz about that. Else I will take a look ;)
Regards
JB
On 09/05/2016 10:44 AM, CLEMENT Jean-Philippe wrote:
> Ah yes, that Jira https://issues.apache.org/jira/browse/ARIES-1311 - Thank you Lichtin!
>
> The enhancement seems not to be planned for resolution. Is there a way to "activate" this Jira?
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : lichtin [mailto:lichtin@yahoo.com]
> Envoy� : vendredi 2 septembre 2016 19:09
> � : user@karaf.apache.org
> Objet : RE: Inject system property value via blueprint
>
> See
> http://karaf.922171.n3.nabble.com/Environment-variables-and-Blueprint-tp4039607p4039613.html
>
>
> CLEMENT Jean-Philippe wrote
>> Ok... is there a way to use env variables other than via system variables?
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofr� [mailto:
>
>> jb@
>
>> ]
>> Envoy� : vendredi 2 septembre 2016 16:19 � :
>
>> user@.apache
>
>> Objet : Re: Inject system property value via blueprint
>>
>> Ha, ok understood.
>>
>> So, it's about env variables more than system variables. System
>> variables for me are passed using -D on the JVM.
>>
>> Regards
>> JB
>>
>> On 09/02/2016 03:41 PM, CLEMENT Jean-Philippe wrote:
>>> I'm not too sure it's the same need => at present time to get an
>>> environment variable in a cfg I have to modify the setenv (export
>>> KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a
>>> cfg (SOME_KEY=${my.variable}).
>>>
>>> But I have to "declare" each variable in the setenv scripts... Could
>>> be nice to get environment variables directly, for instance
>>> SOME_KEY=$[MY_ENV_VARIABLE]
>>>
>>> Regards,
>>> JP
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofr� [mailto:
>
>> jb@
>
>> ] Envoy� : vendredi 2
>>> septembre 2016 15:29 � :
>
>> user@.apache
>
>> Objet : Re: Inject
>>> system property value via blueprint
>>>
>>> OK, it sounds like this one then:
>>>
>>> https://issues.apache.org/jira/browse/KARAF-4609
>>>
>>> Regards
>>> JB
>>>
>>> On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
>>>> Ah, I mean more environment related such as "export
>>>> MY_PROPERTY=something" the use it in Karaf via something like
>>>> $[MY_PROPERTY].
>>>>
>>>> I think we already had this discussion but I did not succeed in
>>>> finding a corresponding Jira (?)
>>>>
>>>> Regards,
>>>> JP
>>>>
>>>> -----Message d'origine-----
>>>> De : Jean-Baptiste Onofr� [mailto:
>
>> jb@
>
>> ] Envoy� : vendredi
>>>> 2 septembre 2016 14:36 � :
>
>> user@.apache
>
>> Objet : Re: Inject
>>>> system property value via blueprint
>>>>
>>>> You mean to be able to use ${sys.user.home} in a cfg file where
>>>> user.home is the system property ?
>>>>
>>>> Maybe it's related to:
>>>> https://issues.apache.org/jira/browse/KARAF-4609
>>>> https://issues.apache.org/jira/browse/KARAF-3949
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>>>>> Hi JB,
>>>>>
>>>>> Does it also work for .cfg files?
>>>>>
>>>>> Regards,
>>>>> JP
>>>>>
>>>>> -----Message d'origine-----
>>>>> De : Jean-Baptiste Onofr� [mailto:
>
>> jb@
>
>> ] Envoy� : mercredi
>>>>> 31 ao�t 2016 15:49 � :
>
>> user@.apache
>
>> Objet : Re: Inject
>>>>> system property value via blueprint
>>>>>
>>>>> Hi,
>>>>>
>>>>> you have to use the ext xmlns for that.
>>>>>
>>>>> Just add the following in your blueprint:
>>>>>
>>>>>
>
>>
>>>>>
>> <ext:property-placeholder placeholder-prefix="$["
>>>
>>>> placeholder-suffix="]" />
>>>>>
>>>>> Then, you can use system properties with $[foo].
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 08/31/2016 03:46 PM, ellirael wrote:
>>>>>> I saw an example how to inject property values which are defined in
>>>>>> config file.
>>>>>> It is some thing like this:
>>>>>>
>>>>>>
>> <cm:property-placeholder persistent-id="ConfigApp"
>> update-strategy="reload"
>>>
>>>>>>
>>>>>>
>> <cm:default-properties>
>>>>>>
>> <cm:property name="title" value="Default Title"/>
>>
>>>>>>
>> </cm:default-properties>
>>
>> </cm:property-placeholder>
>>
>> <bean id="myApp"
>>>
>>>>> init-method="refresh">
>> <property name="title"
>>>
>>>>> value="$\{title\}">
>> </property>
>>
>> </bean>
>>>>>>
>>>>>> How to do the same with the system property printed by
>>>>>> system:property command output?
>>>>>> Or how to gain access to those system properties values?
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-
>>>>>> b l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>>>>> archive at Nabble.com.
>>>>>>
>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofr�
>>>>>
>
>> jbonofre@
>
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofr�
>>>>
>
>> jbonofre@
>
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofr�
>>>
>
>> jbonofre@
>
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>> --
>> Jean-Baptiste Onofr�
>
>> jbonofre@
>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blueprint-tp4047779p4047852.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
RE: Inject system property value via blueprint
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Ah yes, that Jira https://issues.apache.org/jira/browse/ARIES-1311 - Thank you Lichtin!
The enhancement seems not to be planned for resolution. Is there a way to "activate" this Jira?
Regards,
JP
-----Message d'origine-----
De : lichtin [mailto:lichtin@yahoo.com]
Envoyé : vendredi 2 septembre 2016 19:09
À : user@karaf.apache.org
Objet : RE: Inject system property value via blueprint
See
http://karaf.922171.n3.nabble.com/Environment-variables-and-Blueprint-tp4039607p4039613.html
CLEMENT Jean-Philippe wrote
> Ok... is there a way to use env variables other than via system variables?
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:
> jb@
> ]
> Envoyé : vendredi 2 septembre 2016 16:19 À :
> user@.apache
> Objet : Re: Inject system property value via blueprint
>
> Ha, ok understood.
>
> So, it's about env variables more than system variables. System
> variables for me are passed using -D on the JVM.
>
> Regards
> JB
>
> On 09/02/2016 03:41 PM, CLEMENT Jean-Philippe wrote:
>> I'm not too sure it's the same need => at present time to get an
>> environment variable in a cfg I have to modify the setenv (export
>> KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a
>> cfg (SOME_KEY=${my.variable}).
>>
>> But I have to "declare" each variable in the setenv scripts... Could
>> be nice to get environment variables directly, for instance
>> SOME_KEY=$[MY_ENV_VARIABLE]
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:
> jb@
> ] Envoyé : vendredi 2
>> septembre 2016 15:29 À :
> user@.apache
> Objet : Re: Inject
>> system property value via blueprint
>>
>> OK, it sounds like this one then:
>>
>> https://issues.apache.org/jira/browse/KARAF-4609
>>
>> Regards
>> JB
>>
>> On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
>>> Ah, I mean more environment related such as "export
>>> MY_PROPERTY=something" the use it in Karaf via something like
>>> $[MY_PROPERTY].
>>>
>>> I think we already had this discussion but I did not succeed in
>>> finding a corresponding Jira (?)
>>>
>>> Regards,
>>> JP
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofré [mailto:
> jb@
> ] Envoyé : vendredi
>>> 2 septembre 2016 14:36 À :
> user@.apache
> Objet : Re: Inject
>>> system property value via blueprint
>>>
>>> You mean to be able to use ${sys.user.home} in a cfg file where
>>> user.home is the system property ?
>>>
>>> Maybe it's related to:
>>> https://issues.apache.org/jira/browse/KARAF-4609
>>> https://issues.apache.org/jira/browse/KARAF-3949
>>>
>>> Regards
>>> JB
>>>
>>> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>>>> Hi JB,
>>>>
>>>> Does it also work for .cfg files?
>>>>
>>>> Regards,
>>>> JP
>>>>
>>>> -----Message d'origine-----
>>>> De : Jean-Baptiste Onofré [mailto:
> jb@
> ] Envoyé : mercredi
>>>> 31 août 2016 15:49 À :
> user@.apache
> Objet : Re: Inject
>>>> system property value via blueprint
>>>>
>>>> Hi,
>>>>
>>>> you have to use the ext xmlns for that.
>>>>
>>>> Just add the following in your blueprint:
>>>>
>>>>
>
>>>>
> <ext:property-placeholder placeholder-prefix="$["
>>
>>> placeholder-suffix="]" />
>>>>
>>>> Then, you can use system properties with $[foo].
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 08/31/2016 03:46 PM, ellirael wrote:
>>>>> I saw an example how to inject property values which are defined in
>>>>> config file.
>>>>> It is some thing like this:
>>>>>
>>>>>
> <cm:property-placeholder persistent-id="ConfigApp"
> update-strategy="reload"
>>
>>>>>
>>>>>
> <cm:default-properties>
>>>>>
> <cm:property name="title" value="Default Title"/>
>
>>>>>
> </cm:default-properties>
>
> </cm:property-placeholder>
>
> <bean id="myApp"
>>
>>>> init-method="refresh">
> <property name="title"
>>
>>>> value="$\{title\}">
> </property>
>
> </bean>
>>>>>
>>>>> How to do the same with the system property printed by
>>>>> system:property command output?
>>>>> Or how to gain access to those system properties values?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-
>>>>> b l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>>>> archive at Nabble.com.
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>>
> jbonofre@
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>>
> jbonofre@
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>> --
>> Jean-Baptiste Onofré
>>
> jbonofre@
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@
> http://blog.nanthrax.net
> Talend - http://www.talend.com
--
View this message in context: http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blueprint-tp4047779p4047852.html
Sent from the Karaf - User mailing list archive at Nabble.com.
RE: Inject system property value via blueprint
Posted by lichtin <li...@yahoo.com>.
See
http://karaf.922171.n3.nabble.com/Environment-variables-and-Blueprint-tp4039607p4039613.html
CLEMENT Jean-Philippe wrote
> Ok... is there a way to use env variables other than via system variables?
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:
> jb@
> ]
> Envoyé : vendredi 2 septembre 2016 16:19
> À :
> user@.apache
> Objet : Re: Inject system property value via blueprint
>
> Ha, ok understood.
>
> So, it's about env variables more than system variables. System variables
> for me are passed using -D on the JVM.
>
> Regards
> JB
>
> On 09/02/2016 03:41 PM, CLEMENT Jean-Philippe wrote:
>> I'm not too sure it's the same need => at present time to get an
>> environment variable in a cfg I have to modify the setenv (export
>> KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a cfg
>> (SOME_KEY=${my.variable}).
>>
>> But I have to "declare" each variable in the setenv scripts... Could
>> be nice to get environment variables directly, for instance
>> SOME_KEY=$[MY_ENV_VARIABLE]
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:
> jb@
> ] Envoyé : vendredi 2
>> septembre 2016 15:29 À :
> user@.apache
> Objet : Re: Inject
>> system property value via blueprint
>>
>> OK, it sounds like this one then:
>>
>> https://issues.apache.org/jira/browse/KARAF-4609
>>
>> Regards
>> JB
>>
>> On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
>>> Ah, I mean more environment related such as "export
>>> MY_PROPERTY=something" the use it in Karaf via something like
>>> $[MY_PROPERTY].
>>>
>>> I think we already had this discussion but I did not succeed in
>>> finding a corresponding Jira (?)
>>>
>>> Regards,
>>> JP
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofré [mailto:
> jb@
> ] Envoyé : vendredi
>>> 2 septembre 2016 14:36 À :
> user@.apache
> Objet : Re: Inject
>>> system property value via blueprint
>>>
>>> You mean to be able to use ${sys.user.home} in a cfg file where
>>> user.home is the system property ?
>>>
>>> Maybe it's related to:
>>> https://issues.apache.org/jira/browse/KARAF-4609
>>> https://issues.apache.org/jira/browse/KARAF-3949
>>>
>>> Regards
>>> JB
>>>
>>> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>>>> Hi JB,
>>>>
>>>> Does it also work for .cfg files?
>>>>
>>>> Regards,
>>>> JP
>>>>
>>>> -----Message d'origine-----
>>>> De : Jean-Baptiste Onofré [mailto:
> jb@
> ] Envoyé : mercredi
>>>> 31 août 2016 15:49 À :
> user@.apache
> Objet : Re: Inject
>>>> system property value via blueprint
>>>>
>>>> Hi,
>>>>
>>>> you have to use the ext xmlns for that.
>>>>
>>>> Just add the following in your blueprint:
>>>>
>>>>
>
>>>>
> <ext:property-placeholder placeholder-prefix="$["
>>
>>> placeholder-suffix="]" />
>>>>
>>>> Then, you can use system properties with $[foo].
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 08/31/2016 03:46 PM, ellirael wrote:
>>>>> I saw an example how to inject property values which are defined in
>>>>> config file.
>>>>> It is some thing like this:
>>>>>
>>>>>
> <cm:property-placeholder persistent-id="ConfigApp"
> update-strategy="reload"
>>
>>>>>
>>>>>
> <cm:default-properties>
>>>>>
> <cm:property name="title" value="Default Title"/>
>
>>>>>
> </cm:default-properties>
>
> </cm:property-placeholder>
>
> <bean id="myApp"
>>
>>>> init-method="refresh">
> <property name="title"
>>
>>>> value="$\{title\}">
> </property>
>
> </bean>
>>>>>
>>>>> How to do the same with the system property printed by
>>>>> system:property command output?
>>>>> Or how to gain access to those system properties values?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-
>>>>> b l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>>>> archive at Nabble.com.
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>>
> jbonofre@
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>>
> jbonofre@
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>> --
>> Jean-Baptiste Onofré
>>
> jbonofre@
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@
> http://blog.nanthrax.net
> Talend - http://www.talend.com
--
View this message in context: http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blueprint-tp4047779p4047852.html
Sent from the Karaf - User mailing list archive at Nabble.com.
RE: Inject system property value via blueprint
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Ok... is there a way to use env variables other than via system variables?
Regards,
JP
-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
Envoyé : vendredi 2 septembre 2016 16:19
À : user@karaf.apache.org
Objet : Re: Inject system property value via blueprint
Ha, ok understood.
So, it's about env variables more than system variables. System variables for me are passed using -D on the JVM.
Regards
JB
On 09/02/2016 03:41 PM, CLEMENT Jean-Philippe wrote:
> I'm not too sure it's the same need => at present time to get an environment variable in a cfg I have to modify the setenv (export KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a cfg (SOME_KEY=${my.variable}).
>
> But I have to "declare" each variable in the setenv scripts... Could
> be nice to get environment variables directly, for instance
> SOME_KEY=$[MY_ENV_VARIABLE]
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : vendredi 2
> septembre 2016 15:29 À : user@karaf.apache.org Objet : Re: Inject
> system property value via blueprint
>
> OK, it sounds like this one then:
>
> https://issues.apache.org/jira/browse/KARAF-4609
>
> Regards
> JB
>
> On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
>> Ah, I mean more environment related such as "export MY_PROPERTY=something" the use it in Karaf via something like $[MY_PROPERTY].
>>
>> I think we already had this discussion but I did not succeed in
>> finding a corresponding Jira (?)
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : vendredi
>> 2 septembre 2016 14:36 À : user@karaf.apache.org Objet : Re: Inject
>> system property value via blueprint
>>
>> You mean to be able to use ${sys.user.home} in a cfg file where user.home is the system property ?
>>
>> Maybe it's related to:
>> https://issues.apache.org/jira/browse/KARAF-4609
>> https://issues.apache.org/jira/browse/KARAF-3949
>>
>> Regards
>> JB
>>
>> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>>> Hi JB,
>>>
>>> Does it also work for .cfg files?
>>>
>>> Regards,
>>> JP
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : mercredi
>>> 31 août 2016 15:49 À : user@karaf.apache.org Objet : Re: Inject
>>> system property value via blueprint
>>>
>>> Hi,
>>>
>>> you have to use the ext xmlns for that.
>>>
>>> Just add the following in your blueprint:
>>>
>>> <!-- Allow the use of system properties -->
>>> <ext:property-placeholder placeholder-prefix="$["
>>> placeholder-suffix="]" />
>>>
>>> Then, you can use system properties with $[foo].
>>>
>>> Regards
>>> JB
>>>
>>> On 08/31/2016 03:46 PM, ellirael wrote:
>>>> I saw an example how to inject property values which are defined in
>>>> config file.
>>>> It is some thing like this:
>>>>
>>>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>>>
>>>> <cm:default-properties>
>>>> <cm:property name="title" value="Default Title"/>
>>>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>>>> init-method="refresh"> <property name="title"
>>>> value="$\{title\}"></property> </bean>
>>>>
>>>> How to do the same with the system property printed by
>>>> system:property command output?
>>>> Or how to gain access to those system properties values?
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-
>>>> b l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>>> archive at Nabble.com.
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Inject system property value via blueprint
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Ha, ok understood.
So, it's about env variables more than system variables. System
variables for me are passed using -D on the JVM.
Regards
JB
On 09/02/2016 03:41 PM, CLEMENT Jean-Philippe wrote:
> I'm not too sure it's the same need => at present time to get an environment variable in a cfg I have to modify the setenv (export KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a cfg (SOME_KEY=${my.variable}).
>
> But I have to "declare" each variable in the setenv scripts... Could be nice to get environment variables directly, for instance SOME_KEY=$[MY_ENV_VARIABLE]
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofr [mailto:jb@nanthrax.net]
> Envoy : vendredi 2 septembre 2016 15:29
> : user@karaf.apache.org
> Objet : Re: Inject system property value via blueprint
>
> OK, it sounds like this one then:
>
> https://issues.apache.org/jira/browse/KARAF-4609
>
> Regards
> JB
>
> On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
>> Ah, I mean more environment related such as "export MY_PROPERTY=something" the use it in Karaf via something like $[MY_PROPERTY].
>>
>> I think we already had this discussion but I did not succeed in
>> finding a corresponding Jira (?)
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofr [mailto:jb@nanthrax.net] Envoy : vendredi 2
>> septembre 2016 14:36 : user@karaf.apache.org Objet : Re: Inject
>> system property value via blueprint
>>
>> You mean to be able to use ${sys.user.home} in a cfg file where user.home is the system property ?
>>
>> Maybe it's related to:
>> https://issues.apache.org/jira/browse/KARAF-4609
>> https://issues.apache.org/jira/browse/KARAF-3949
>>
>> Regards
>> JB
>>
>> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>>> Hi JB,
>>>
>>> Does it also work for .cfg files?
>>>
>>> Regards,
>>> JP
>>>
>>> -----Message d'origine-----
>>> De : Jean-Baptiste Onofr [mailto:jb@nanthrax.net] Envoy : mercredi
>>> 31 aot 2016 15:49 : user@karaf.apache.org Objet : Re: Inject
>>> system property value via blueprint
>>>
>>> Hi,
>>>
>>> you have to use the ext xmlns for that.
>>>
>>> Just add the following in your blueprint:
>>>
>>> <!-- Allow the use of system properties --> <ext:property-placeholder
>>> placeholder-prefix="$[" placeholder-suffix="]" />
>>>
>>> Then, you can use system properties with $[foo].
>>>
>>> Regards
>>> JB
>>>
>>> On 08/31/2016 03:46 PM, ellirael wrote:
>>>> I saw an example how to inject property values which are defined in
>>>> config file.
>>>> It is some thing like this:
>>>>
>>>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>>>
>>>> <cm:default-properties>
>>>> <cm:property name="title" value="Default Title"/>
>>>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>>>> init-method="refresh"> <property name="title"
>>>> value="$\{title\}"></property> </bean>
>>>>
>>>> How to do the same with the system property printed by
>>>> system:property command output?
>>>> Or how to gain access to those system properties values?
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-b
>>>> l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>>> archive at Nabble.com.
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofr
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>> --
>> Jean-Baptiste Onofr
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofr
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
RE: Inject system property value via blueprint
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
I'm not too sure it's the same need => at present time to get an environment variable in a cfg I have to modify the setenv (export KARAF_OPTS="-Dmy.variable=$MY_ENV_VARIABLE") then I may use it in a cfg (SOME_KEY=${my.variable}).
But I have to "declare" each variable in the setenv scripts... Could be nice to get environment variables directly, for instance SOME_KEY=$[MY_ENV_VARIABLE]
Regards,
JP
-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
Envoyé : vendredi 2 septembre 2016 15:29
À : user@karaf.apache.org
Objet : Re: Inject system property value via blueprint
OK, it sounds like this one then:
https://issues.apache.org/jira/browse/KARAF-4609
Regards
JB
On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
> Ah, I mean more environment related such as "export MY_PROPERTY=something" the use it in Karaf via something like $[MY_PROPERTY].
>
> I think we already had this discussion but I did not succeed in
> finding a corresponding Jira (?)
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : vendredi 2
> septembre 2016 14:36 À : user@karaf.apache.org Objet : Re: Inject
> system property value via blueprint
>
> You mean to be able to use ${sys.user.home} in a cfg file where user.home is the system property ?
>
> Maybe it's related to:
> https://issues.apache.org/jira/browse/KARAF-4609
> https://issues.apache.org/jira/browse/KARAF-3949
>
> Regards
> JB
>
> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>> Hi JB,
>>
>> Does it also work for .cfg files?
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : mercredi
>> 31 août 2016 15:49 À : user@karaf.apache.org Objet : Re: Inject
>> system property value via blueprint
>>
>> Hi,
>>
>> you have to use the ext xmlns for that.
>>
>> Just add the following in your blueprint:
>>
>> <!-- Allow the use of system properties --> <ext:property-placeholder
>> placeholder-prefix="$[" placeholder-suffix="]" />
>>
>> Then, you can use system properties with $[foo].
>>
>> Regards
>> JB
>>
>> On 08/31/2016 03:46 PM, ellirael wrote:
>>> I saw an example how to inject property values which are defined in
>>> config file.
>>> It is some thing like this:
>>>
>>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>>
>>> <cm:default-properties>
>>> <cm:property name="title" value="Default Title"/>
>>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>>> init-method="refresh"> <property name="title"
>>> value="$\{title\}"></property> </bean>
>>>
>>> How to do the same with the system property printed by
>>> system:property command output?
>>> Or how to gain access to those system properties values?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-b
>>> l u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>> archive at Nabble.com.
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Inject system property value via blueprint
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK, it sounds like this one then:
https://issues.apache.org/jira/browse/KARAF-4609
Regards
JB
On 09/02/2016 03:22 PM, CLEMENT Jean-Philippe wrote:
> Ah, I mean more environment related such as "export MY_PROPERTY=something" the use it in Karaf via something like $[MY_PROPERTY].
>
> I think we already had this discussion but I did not succeed in finding a corresponding Jira (?)
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofr [mailto:jb@nanthrax.net]
> Envoy : vendredi 2 septembre 2016 14:36
> : user@karaf.apache.org
> Objet : Re: Inject system property value via blueprint
>
> You mean to be able to use ${sys.user.home} in a cfg file where user.home is the system property ?
>
> Maybe it's related to:
> https://issues.apache.org/jira/browse/KARAF-4609
> https://issues.apache.org/jira/browse/KARAF-3949
>
> Regards
> JB
>
> On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
>> Hi JB,
>>
>> Does it also work for .cfg files?
>>
>> Regards,
>> JP
>>
>> -----Message d'origine-----
>> De : Jean-Baptiste Onofr [mailto:jb@nanthrax.net] Envoy : mercredi
>> 31 aot 2016 15:49 : user@karaf.apache.org Objet : Re: Inject system
>> property value via blueprint
>>
>> Hi,
>>
>> you have to use the ext xmlns for that.
>>
>> Just add the following in your blueprint:
>>
>> <!-- Allow the use of system properties --> <ext:property-placeholder
>> placeholder-prefix="$[" placeholder-suffix="]" />
>>
>> Then, you can use system properties with $[foo].
>>
>> Regards
>> JB
>>
>> On 08/31/2016 03:46 PM, ellirael wrote:
>>> I saw an example how to inject property values which are defined in
>>> config file.
>>> It is some thing like this:
>>>
>>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>>
>>> <cm:default-properties>
>>> <cm:property name="title" value="Default Title"/>
>>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>>> init-method="refresh"> <property name="title"
>>> value="$\{title\}"></property> </bean>
>>>
>>> How to do the same with the system property printed by
>>> system:property command output?
>>> Or how to gain access to those system properties values?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-bl
>>> u eprint-tp4047779.html Sent from the Karaf - User mailing list
>>> archive at Nabble.com.
>>>
>>
>> --
>> Jean-Baptiste Onofr
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
> --
> Jean-Baptiste Onofr
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
RE: Inject system property value via blueprint
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Ah, I mean more environment related such as "export MY_PROPERTY=something" the use it in Karaf via something like $[MY_PROPERTY].
I think we already had this discussion but I did not succeed in finding a corresponding Jira (?)
Regards,
JP
-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
Envoyé : vendredi 2 septembre 2016 14:36
À : user@karaf.apache.org
Objet : Re: Inject system property value via blueprint
You mean to be able to use ${sys.user.home} in a cfg file where user.home is the system property ?
Maybe it's related to:
https://issues.apache.org/jira/browse/KARAF-4609
https://issues.apache.org/jira/browse/KARAF-3949
Regards
JB
On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
> Hi JB,
>
> Does it also work for .cfg files?
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] Envoyé : mercredi
> 31 août 2016 15:49 À : user@karaf.apache.org Objet : Re: Inject system
> property value via blueprint
>
> Hi,
>
> you have to use the ext xmlns for that.
>
> Just add the following in your blueprint:
>
> <!-- Allow the use of system properties --> <ext:property-placeholder
> placeholder-prefix="$[" placeholder-suffix="]" />
>
> Then, you can use system properties with $[foo].
>
> Regards
> JB
>
> On 08/31/2016 03:46 PM, ellirael wrote:
>> I saw an example how to inject property values which are defined in
>> config file.
>> It is some thing like this:
>>
>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>
>> <cm:default-properties>
>> <cm:property name="title" value="Default Title"/>
>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>> init-method="refresh"> <property name="title"
>> value="$\{title\}"></property> </bean>
>>
>> How to do the same with the system property printed by
>> system:property command output?
>> Or how to gain access to those system properties values?
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-bl
>> u eprint-tp4047779.html Sent from the Karaf - User mailing list
>> archive at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Inject system property value via blueprint
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You mean to be able to use ${sys.user.home} in a cfg file where
user.home is the system property ?
Maybe it's related to:
https://issues.apache.org/jira/browse/KARAF-4609
https://issues.apache.org/jira/browse/KARAF-3949
Regards
JB
On 09/02/2016 02:30 PM, CLEMENT Jean-Philippe wrote:
> Hi JB,
>
> Does it also work for .cfg files?
>
> Regards,
> JP
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofr [mailto:jb@nanthrax.net]
> Envoy : mercredi 31 aot 2016 15:49
> : user@karaf.apache.org
> Objet : Re: Inject system property value via blueprint
>
> Hi,
>
> you have to use the ext xmlns for that.
>
> Just add the following in your blueprint:
>
> <!-- Allow the use of system properties --> <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]" />
>
> Then, you can use system properties with $[foo].
>
> Regards
> JB
>
> On 08/31/2016 03:46 PM, ellirael wrote:
>> I saw an example how to inject property values which are defined in
>> config file.
>> It is some thing like this:
>>
>> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>>
>> <cm:default-properties>
>> <cm:property name="title" value="Default Title"/>
>> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
>> init-method="refresh"> <property name="title"
>> value="$\{title\}"></property> </bean>
>>
>> How to do the same with the system property printed by system:property
>> command output?
>> Or how to gain access to those system properties values?
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blu
>> eprint-tp4047779.html Sent from the Karaf - User mailing list archive
>> at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofr
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
RE: Inject system property value via blueprint
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Hi JB,
Does it also work for .cfg files?
Regards,
JP
-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
Envoyé : mercredi 31 août 2016 15:49
À : user@karaf.apache.org
Objet : Re: Inject system property value via blueprint
Hi,
you have to use the ext xmlns for that.
Just add the following in your blueprint:
<!-- Allow the use of system properties --> <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]" />
Then, you can use system properties with $[foo].
Regards
JB
On 08/31/2016 03:46 PM, ellirael wrote:
> I saw an example how to inject property values which are defined in
> config file.
> It is some thing like this:
>
> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>
> <cm:default-properties>
> <cm:property name="title" value="Default Title"/>
> </cm:default-properties> </cm:property-placeholder> <bean id="myApp"
> init-method="refresh"> <property name="title"
> value="$\{title\}"></property> </bean>
>
> How to do the same with the system property printed by system:property
> command output?
> Or how to gain access to those system properties values?
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blu
> eprint-tp4047779.html Sent from the Karaf - User mailing list archive
> at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Inject system property value via blueprint
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
you have to use the ext xmlns for that.
Just add the following in your blueprint:
<!-- Allow the use of system properties --> <ext:property-placeholder
placeholder-prefix="$[" placeholder-suffix="]" />
Then, you can use system properties with $[foo].
Regards
JB
On 08/31/2016 03:46 PM, ellirael wrote:
> I saw an example how to inject property values which are defined in config
> file.
> It is some thing like this:
>
> <cm:property-placeholder persistent-id="ConfigApp" update-strategy="reload"
>>
> <cm:default-properties>
> <cm:property name="title" value="Default Title"/>
> </cm:default-properties>
> </cm:property-placeholder>
> <bean id="myApp" init-method="refresh">
> <property name="title" value="$\{title\}"></property>
> </bean>
>
> How to do the same with the system property printed by system:property
> command output?
> Or how to gain access to those system properties values?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Inject-system-property-value-via-blueprint-tp4047779.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com