-
1. Re: Properties File
gertv May 5, 2009 4:15 AM (in response to mjacobs84)L.S.,
For FUSE ESB 4.1, we moved to Spring DM 1.2.0-m2. One of the changes compared to the Spring DM 1.0.x series, is the use of the configadmin properties.
You now have two separate tags, one for reading entries out of the ConfigAdmin service into a Map:
<!-- Configuration Admin entry --> <osgix:cm-properties id="cmProps" persistent-id="com.xyz.myapp"> <prop key="host">localhost</prop> </osgix:cm-properties>
And one for making the map available through the property placeholder syntax:
<!-- placeholder configurer --> <ctx:property-placeholder properties-ref="cmProps"></ctx:property-placeholder>
Replacing your <osgix:property-placeholder> with this combo should solve your problem. For some background information, have a look at http://static.springframework.org/osgi/docs/1.2.0/reference/html/compendium.html#compendium:cm
Regards,
Gert
-
2. Re: Properties File
rmcavalcante Jun 15, 2009 7:06 AM (in response to gertv)Hi,
I just followed your instructions to adapt the configuration admin entry and it works ok for the placeholder, but it does not read the configuration file.
The bundle is up, I update it after each build and it is reported as Started by osgi.
Here goes my files so you can take a look.
*************************************************
bundle-context.xml:
************************************************
properties file: /etc/payments.cfg
connection.url=frodo:8080
************************************************
Now a little bit about my enviroment:
Ubuntu 9.04 - Jaunty Jackalope
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
Eclipse Version: 3.4.2, Build id: M20090211-1700, Full
Fuse version: apache-servicemix-4.1.0.0-fuse
-
When I switch to log console and do 'd' it appears:
12:45:53,881 | DEBUG | xtenderThread-87 | PaymentsApi | ? ? | connectionUrl = ubuntu:8080
from osgi console, list:
Hope you can help.
Thanks in advance
-
3. Re: Properties File
rmcavalcante Jun 16, 2009 3:47 AM (in response to rmcavalcante)I figured out what was the problem.
I was placing the payments.cfg file inside /etc, instead it should be at /path_to_fuse_esb/my_fuse_esb_installation/etc.
I just place the file there and refreshed my osgi bundle and it worked.
Sorry for my silly mistake.
Best regards, Roberto.
-
4. Re: Properties File
simonepringle Jun 25, 2009 10:16 AM (in response to rmcavalcante)Thank you for the explanation about how Fuse 4.1 is handling properties now.
I can't be too sure, but I think that the archetype(s) may need to be updated?
I created a Maven project (in Eclipse) using the servicemix-osgi-camel-archetype from repo.fusesource.maven2 and this is what it auto-generated (see below).
Does the archetype need to be updated or am I missing something?
Thanks,
Simone
<property name="prefix" value="$"/>
-
5. Re: Properties File
stlewis Jun 26, 2009 10:37 AM (in response to simonepringle)Hi Simon, it sure does need to be updated, I've created ESB-764 to make sure it's tracked.