Community
Participate
Working Groups
This is the same problem reported by bug 90980. I've looked through the code and don't see any doPrivs (nor do they show up in the stack trace below). Perhaps the fix was dropped? A fix for this in 3.1.1 or 3.1.2 would be quite helpful. Here is the stack trace: java.security.AccessControlException: Access denied (org.osgi.framework.ServicePermission org.osgi.service.url.URLStreamHandlerService get) at java.security.AccessController.checkPermission(AccessController.java:107) at java.lang.SecurityManager.checkPermission(SecurityManager.java:547) at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:188) at org.eclipse.osgi.framework.internal.core.Framework.checkGetServicePermission(Framework.java:1300) at org.eclipse.osgi.framework.internal.core.Framework.getServiceReferences(Framework.java:1174) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getServiceReferences(BundleContextImpl.java:718) at org.osgi.util.tracker.ServiceTracker.getInitialReferences(ServiceTracker.java:305) at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:264) at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:218) at org.eclipse.osgi.framework.internal.protocol.URLStreamHandlerProxy.<init>(URLStreamHandlerProxy.java:61) at org.eclipse.osgi.framework.internal.protocol.StreamHandlerFactory.createURLStreamHandler(StreamHandlerFactory.java:110) at java.net.URL.getURLStreamHandler(URL.java:1137) at java.net.URL.<init>(URL.java:605) at java.net.URL.<init>(URL.java:497) at java.net.URL.<init>(URL.java:446) at com.acme.foo.TestUrlEJB.performTests(TestUrlEJB.java)
I will investigate ...
Created attachment 26413 [details] Proposed fix wraps doPriv around calls to ServiceTracker.open and System.getProperty
I want to get confirmation from Tom Musta that this patch fixes his problem. Pascal, please review patch for 3.1.1 once Tom confirms the fix. Thanks.
I've tested out the change made by Thomas and it works.
Fix released in HEAD (3.2). Waiting for review from Pascal for 3.1.1 maintenance release.
Aren't you now opening the Tracker twice when you have no SecurityManager installed?
Yes, Michael we are. Nice catch, thanks! I will post a new patch.
Created attachment 26445 [details] Better proposed fix Modified fix to avoid opening the ServiceTracker object twice.
This is good to go.
Fixed in 3.1 maintenance branch and HEAD.