Community
Participate
Working Groups
I see the following code in DataSourceTracker.java: public Object addingService(ServiceReference ref) { return ref.getBundle().getBundleContext().getService(ref); } ServiceReference.getBundle() returns the bundle that registered the service referenced by this service reference. Should the above code not be using its own bundle context instead? So, instead of ref.getBundle(), use BundleReference.class.cast(getClass().getClassLoader()).getBundle().
The tracker is not used to obtain services - this line was just filled in to return something resembling the service. However, it never hurts to make it correct just in case someone down the road decide they now want to use the tracker to get the service ;-)