In our project (Osgi, Spring-Dm, Apache-Felix) we are having some issue on production when BundleContext.getService() return null. It happens very seldom, and not at the start, so it's not a misconfiguration problem.
An alternative could be using ServiceTracker to locate the service, but because the error is quite rare I'm not sure if changing it would solve the situation.
The OSGi-specification says that the method returns
My first guess would be that the service is not registered.
By the way, using Spring-DM should make most programmatic accesses to the service registry unneccessary. At least in our companies these calls have been generally forbidden and are only allowed in lower level technical code.