felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ext2" <x...@tongtech.com>
Subject OSGI Configuration cannot take effect immediately
Date Fri, 24 Jun 2011 10:51:26 GMT
Hi:
	Recently, I find my OSGI Application cannot find OSGI Configuration
occasionally.
	A error of ConfigAdmin indicate the osgi configuration has been
bound to one bundle and cannot be visible to another bundle;
	
	While? Or a bug of felix config admin?
	


Some details are list as following ps;

1) Ps. The log details
15:10:44,770 | ERROR | guration Updater | configadmin                      |
5 - org.apache.felix.configadmin - 1.2.4 | Cannot use configuration
wssecurity_resource_out_process for [org.osgi.service.cm.ManagedService,
id=352, bundle=152]: Configuration bound to bundle
mvn:com.tongtech.ti/app-deploy/1.0-SNAPSHOT

Explain of the log:

mvn:com.tongtech.ti/ti-app-deploy/1.0-SNAPSHOT :
	the Bundle which  deploy properties files as osgi config;
Bundle=152: 
	the application bundle which using the osgi config;


2)Ps. Some details of my application
	My application is composed of two bundle (simplified)
	1) AppDeploy bundle:  First deploy a Java Properties File as Dynamic
OSGI Configuration and then deploy and start a application bundle. One
Property File will be transformed to  One OSGI Configuration(pid=file name).
	2) Application Bundle:  lookup the OSGI Configuration by the pid at
start up time, and use it. 
	But occasionally, OSGI Configuration find by application Bundle is
NULL.  
	Dictionary conf = cm.getConfiguration(pid).getProperties() ; //here
conf is null;


3) The configuration is only visible in App Deploy Bundle; 


4) The simplified source code of My application ( details of processing
Factory Osgi is omitted)

1) AppDeploy bundle
String filter = "(felix.fileinstall.filename="+pid+".cfg)";
Configuration[] configs = getConfigAdmin().listConfigurations(filter);
Configuration config = null;
if(configs != null && configs.length>0)
	config = configs[0];
if(config == null){
	config = getConfigurationAdmin().getConfiguration(pid, null);
config.update(properties);

2) application bundle

	Configuration config = getConfigurationAdmin().getConfiguration(pid)
 
//I have ensured,the application bundle started after  AppDeploy has update
config of pid;

	Config.getProperties(); //return null occasionally;




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message