Method of Inner class should use "AbstractOsgiBundleApplicationContext.this" instead of "this".

The method is listed below:

void org.springframework.osgi.context.support.AbstractO sgiBundleApplicationContext.publishContextAsOsgiSe rviceIfNecessary()

// Publish under all the significant interfaces we see
boolean hasSecurity = (System.getSecurityManager() != null);

if (hasSecurity) {
try {
serviceRegistration = AccessController.doPrivileged(new PrivilegedAction<ServiceRegistration>() {
public ServiceRegistration run() {
return getBundleContext().registerService(serviceNames, this, serviceProperties);
}
}, acc);
} catch (AccessControlException ex) {
logger.error("Application context service publication aborted due to security issues "
+ "- does the bundle has the rights to publish the service ? ", ex);
}
} else {
serviceRegistration = getBundleContext().registerService(serviceNames, this, serviceProperties);
}