Hi all,

I faced a curious problem, when trying to use ConfigurationAdmin using the
two below approaches I get different results, the first one works (sometimes
it tries to get service too early, but otherwise OK). But with the second
one I get NullPointerException on this line (stack trace below):
                Configuration configuration = 
m_configAdmin.getConfiguration(testPid);
What is the difference between the two, am I doing something wrong?


1.)
                m_configAdmin = (ConfigurationAdmin)
m_bundleContext.getService(m_bundleContext
                                
.getServiceReference(ConfigurationAdmin.class.getName()));
---------------------------------------------------------------------------------------------
2.)
                ServiceTracker tracker = new ServiceTracker(m_bundleContext, 
                                ConfigurationAdmin.class.getName(), null);
                tracker.open();
                m_configAdmin = 
(ConfigurationAdmin)tracker.waitForService(2000);
                tracker.close();

Relevant part of stack trace:
java.lang.NullPointerException
        at
org.apache.felix.cm.impl.ConfigurationAdminImpl.getConfiguration(ConfigurationAdminImpl.java:93)
        at "my call"

Thanks in advance:
Tamás
-- 
View this message in context: 
http://old.nabble.com/ConfigurationAdmin-ServiceTracker-tp29148119p29148119.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to