You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by catshout <ge...@web.de> on 2015/08/16 17:34:33 UTC

Configuration Admin issue when sharing a config file for Spring beans/Camel routes

Hi everyone,

I've written a bean that is leveraging a configuration file through
Configuration Admin, see below the bean.xml file content



Furthermore I've created a blueprint route that is leveraging the same
configuration file, see below the blueprint xml



Everythings works so far, but when I'm gonna to update the config file
sip.properties in etc folder I'm getting this error

2015-08-16 17:25:43,179 | ERROR | Update: pid=sib) | configadmin                     
| 6 - org.apache.felix.configadmin - 1.8.4 | Cannot use configuration sib
for [org.osgi.service.cm.ManagedService, id=991,
bundle=384/blueprint:file:/home/wbimb/apache-servicemix-6.0.0/deploy/SIBevents.xml]:
No visibility to configuration bound to
file:/home/wbimb/apache-servicemix-6.0.0/deploy/SIBEventProcessor.jar

The SIBEventProcessor.jar is the bean I've mentioned above.

For the error I've found this explanation

https://www.mail-archive.com/users@felix.apache.org/msg14351.html
<https://www.mail-archive.com/users@felix.apache.org/msg14351.html>  

But how can I realize this in my case as everything works declarative
through setter/getter injection?

Any help is really appreciated.



--
View this message in context: http://servicemix.396122.n5.nabble.com/Configuration-Admin-issue-when-sharing-a-config-file-for-Spring-beans-Camel-routes-tp5722877.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Configuration Admin issue when sharing a config file for Spring beans/Camel routes

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Gerald,

afaik this isn't possible as you need a service.
But you always can access the configuration file itself via blueprint,
though the automatic update doesn't work for those anylonger.

regards, Achim


2015-08-17 12:51 GMT+02:00 catshout <ge...@web.de>:

> Many thanks, Achim.
>
> I've created a configuration service in Java. The configuration variables
> within this service are dynamically updated with injection/setter methods.
> Accessing the configuration values from other beans/routes is now possible
> with service getter methods.
>
> Anyway, adding a new configuration parameter requires always a Java code
> change.
>
> Would it be possible so far to define all properties in one blueprint xml
> like
>
>
>
> and access these properties from an other blueprint xml?
>
> Best
> - Gerald
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Configuration-Admin-issue-when-sharing-a-config-file-for-Spring-beans-Camel-routes-tp5722877p5722882.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Configuration Admin issue when sharing a config file for Spring beans/Camel routes

Posted by catshout <ge...@web.de>.
Many thanks, Achim.

I've created a configuration service in Java. The configuration variables
within this service are dynamically updated with injection/setter methods.
Accessing the configuration values from other beans/routes is now possible
with service getter methods.

Anyway, adding a new configuration parameter requires always a Java code
change.

Would it be possible so far to define all properties in one blueprint xml
like



and access these properties from an other blueprint xml?

Best
- Gerald



--
View this message in context: http://servicemix.396122.n5.nabble.com/Configuration-Admin-issue-when-sharing-a-config-file-for-Spring-beans-Camel-routes-tp5722877p5722882.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Configuration Admin issue when sharing a config file for Spring beans/Camel routes

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

a configuration via config admin can only be bound to one single service.
So what you are trying to achieve can actually not be done this way.
You'll need a service which is configured via config admin service and that
service you'll need to reference in your route.
You might use mvel scripting for it, for example.

regards, Achim

2015-08-16 17:34 GMT+02:00 catshout <ge...@web.de>:

> Hi everyone,
>
> I've written a bean that is leveraging a configuration file through
> Configuration Admin, see below the bean.xml file content
>
>
>
> Furthermore I've created a blueprint route that is leveraging the same
> configuration file, see below the blueprint xml
>
>
>
> Everythings works so far, but when I'm gonna to update the config file
> sip.properties in etc folder I'm getting this error
>
> 2015-08-16 17:25:43,179 | ERROR | Update: pid=sib) | configadmin
> | 6 - org.apache.felix.configadmin - 1.8.4 | Cannot use configuration sib
> for [org.osgi.service.cm.ManagedService, id=991,
>
> bundle=384/blueprint:file:/home/wbimb/apache-servicemix-6.0.0/deploy/SIBevents.xml]:
> No visibility to configuration bound to
> file:/home/wbimb/apache-servicemix-6.0.0/deploy/SIBEventProcessor.jar
>
> The SIBEventProcessor.jar is the bean I've mentioned above.
>
> For the error I've found this explanation
>
> https://www.mail-archive.com/users@felix.apache.org/msg14351.html
> <https://www.mail-archive.com/users@felix.apache.org/msg14351.html>
>
> But how can I realize this in my case as everything works declarative
> through setter/getter injection?
>
> Any help is really appreciated.
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Configuration-Admin-issue-when-sharing-a-config-file-for-Spring-beans-Camel-routes-tp5722877.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master