aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARIES-916) Lookup of System BundleContext via JNDI causes AccessControlException
Date Wed, 21 Feb 2018 10:27:00 GMT

    [ https://issues.apache.org/jira/browse/ARIES-916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16371189#comment-16371189
] 

ASF subversion and git services commented on ARIES-916:
-------------------------------------------------------

Commit 1824953 from [~gnt] in branch 'aries/trunk'
[ https://svn.apache.org/r1824953 ]

[ARIES-916] Lookup of System BundleContext via JNDI causes AccessControlException

> Lookup of System BundleContext via JNDI causes AccessControlException
> ---------------------------------------------------------------------
>
>                 Key: ARIES-916
>                 URL: https://issues.apache.org/jira/browse/ARIES-916
>             Project: Aries
>          Issue Type: Bug
>          Components: JNDI
>         Environment: Aries util 1.0.0 (but also happens on 0.3.1)
> This happens with both Equinox 3.7.2 as well as JBoss OSGi 7.2.x
> (Note that these versions aren't available yet in the JIRA versions selector)
>            Reporter: David Bosschaert
>            Priority: Major
>             Fix For: jndi-url-1.1.1
>
>
> When using Aries JNDI to do the following lookup an AccessControlException below occurs:
> {{BundleContext bc = (BundleContext) initialContext.lookup("osgi:framework/bundleContext");}}
> Note that the framework is *not* running with security enabled.
> BTW ordinary service lookups using {{initialContext.lookup("osgi:service/org.acme.Foo")}}
do succeed.
> The exception is:
> {code}The Caller does not have permissions to get the BundleContext. [Root exception
is java.security.AccessControlException: access denied (org.osgi.framework.AdminPermission
(id=7) context)]
>  	at org.apache.aries.jndi.url.ServiceRegistryContext.lookup(ServiceRegistryContext.java:96)
> 	at org.apache.aries.jndi.url.ServiceRegistryContext.lookup(ServiceRegistryContext.java:144)
> 	at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
> 	at jndibundle.Activator.start(Activator.java:19)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
> 	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
> 	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
> 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
> 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:291)
> 	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:333)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:209)
> 	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:155)
> 	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:140)
> 	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:104)
> 	at java.lang.Thread.run(Thread.java:680)
> Caused by: java.security.AccessControlException: access denied (org.osgi.framework.AdminPermission
(id=7) context)
> 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> 	at java.security.AccessController.checkPermission(AccessController.java:546)
> 	at org.apache.aries.jndi.url.ServiceRegistryContext.lookup(ServiceRegistryContext.java:93)
> 	... 21 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message