You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Graham Rhodes (JIRA)" <ji...@apache.org> on 2013/04/19 10:41:16 UTC

[jira] [Commented] (ARIES-980) Aries JNDI breaks JNDI calls from outside OSGI container in embedded scenarios

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

Graham Rhodes commented on ARIES-980:
-------------------------------------

Not sure if this helps as luckily I had access to the bundle context so I could use the below.
{code}
Hashtable<Object, Object> environement = new Hashtable<Object, Object>();
environement.put("osgi.service.jndi.bundleContext", context);
InitialContext ic = new InitialContext(environement);
{code}
                
> Aries JNDI breaks JNDI calls from outside OSGI container in embedded scenarios
> ------------------------------------------------------------------------------
>
>                 Key: ARIES-980
>                 URL: https://issues.apache.org/jira/browse/ARIES-980
>             Project: Aries
>          Issue Type: Bug
>          Components: JNDI
>         Environment: Application with embedded Karaf 2.3.0 containing installed Apache Aries JNDI 1.0.0
>            Reporter: Mike Wilson
>
> When doing
> {code}
> new InitialContext();
> {code}
> from application code outside OSGI container, the following exception is thrown:
> {code}
> javax.naming.NoInitialContextException: The calling code's BundleContext could not be determined.
> 	at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:46)
> 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
> 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
> 	at javax.naming.InitialContext.init(InitialContext.java:242)
> 	at javax.naming.InitialContext.<init>(InitialContext.java:192)
> {code}
> Thus, the outside application can't use JNDI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira