One of our users found the following problem when using Aries JNDI in Karaf:

Exception in thread "JMX Connector Thread
[service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root]"
java.lang.RuntimeException: Could not start JMX connector server
       at 
org.apache.karaf.management.ConnectorServerFactory$1.run(ConnectorServerFactory.java:103)
Caused by: java.io.IOException: Cannot bind to URL
[rmi://localhost:1099/karaf-root]:
javax.naming.NoInitialContextException: Unable to determine caller's
BundleContext
       at 
javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:804)
       at 
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:417)
       at 
org.apache.karaf.management.ConnectorServerFactory$1.run(ConnectorServerFactory.java:101)
Caused by: javax.naming.NoInitialContextException: Unable to determine
caller'sBundleContext
       at 
org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:53)
       at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
       at 
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:316)
       at javax.naming.InitialContext.bind(InitialContext.java:400)
       at 
javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)
       at 
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)
       ... 1 more

The exception is quite clear and kinda expected in that case since the
calls are done from the JRE itself and no TCCL has been set.
Now the question is where the bug is.
I would think that such code should work as it only access the rmi
jndi provider which is built into the JRE and the client code should
not have to be OSGi aware.

Thoughts ?

-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Reply via email to