-
May 28th, 2010, 02:26 AM
#1
Validation error while register OSGI service if SecurityManager is set
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);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules