You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jhusby <hu...@umn.edu> on 2013/02/08 20:31:24 UTC

Copying etc cfg files to a karaf child instance

I've been playing around with creating child instances in karaf with
admin:create and notice that they only copy a minimal portion of the karaf
directory structure.  The problem is that my applications use spring-dm cfg
files to read in properties for each bundle like this:

<osgix:cm-properties id="cmProps" persistent-id="com.foo.bar">
    <prop key="myProperty">myValue</prop>
</osgix:cm-properties>
<ctx:property-placeholder properties-ref="cmProps" />

Is there any way to copy over these cfg files when I create a child
instance?  If not, how can I work around this to be able to read in my
configuration in the child container?  It seems like the child is
referencing the parent's system directory, because it is empty yet still
able to resolve all the features.  But it must not be doing this for the etc
directory...?

Thank you very much for your help!

Joseph



--
View this message in context: http://karaf.922171.n3.nabble.com/Copying-etc-cfg-files-to-a-karaf-child-instance-tp4027675.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Copying etc cfg files to a karaf child instance

Posted by Taro Fukunaga <ta...@gmail.com>.
I see some hints on how to create config files automatically. Maybe this will
help:
1) See http://karaf.apache.org/manual/2.2.5/users-guide/provisioning.html in
the section about Configuration fies
2) Look at src/assemblies/features/standard/src/main/resources/features.xml
and see how it has a entry for configfile for the http feature. 

I think you'll need to make your config file an artifact and deploy it so
that it can be resolved.

Then when you start your new instance, the feature will automatically create
the config file.



--
View this message in context: http://karaf.922171.n3.nabble.com/Copying-etc-cfg-files-to-a-karaf-child-instance-tp4027675p4027677.html
Sent from the Karaf - User mailing list archive at Nabble.com.