Re: Startup problems: javax.naming.NoInitialContextException: Unable to determine caller'sBundleContext

2010-11-30 Thread Ioannis Canellos
Hi Bengt,

Do you install/uninstall anything between the restarts?

On Tue, Nov 30, 2010 at 10:56 AM, Bengt Rodehav be...@rodehav.com wrote:

 I use Karaf 2.1.2. On a clean startup (the data directory is empty)
 everything works OK. However, when I restart Karaf (without cleaning out the
 data directory) I consistently get the following exception:

 *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*


 Does anyone have any idea what could be wrong? I'm thinking there may be
 timing errors. Note that the exception is only logged to the console - not
 to the log file. Perhaps it occurs before the logging bundle is installed.

 I haven't seen this in previous versions of Karaf (2.1.0 and 1.6.0) but
 I've also added and changed a lot of bundles in addition to upgrading to
 Karaf 2.1.2. Thus I don't know for sure if this is a problem specific to
 Karaf 2.1.2.

 /Bengt




-- 
*Ioannis Canellos*
http://iocanel.blogspot.com
Integration Engineer @ Upstream S.A. http://www.upstreamsystems.com


Re: Startup problems: javax.naming.NoInitialContextException: Unable to determine caller'sBundleContext

2010-11-30 Thread Guillaume Nodet
This exception comes from the aries jndi bundle it seems.
I've tested various combinations of karaf and aries jndi, but all seem
to have this behavior.
COuld you please raise a JIRA issue ?
I'm not sure yet, but I suspect the problem is in the aries jndi bundle.

On Tue, Nov 30, 2010 at 08:56, Bengt Rodehav be...@rodehav.com wrote:
 I use Karaf 2.1.2. On a clean startup (the data directory is empty)
 everything works OK. However, when I restart Karaf (without cleaning out the
 data directory) I consistently get the following exception:

 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

 Does anyone have any idea what could be wrong? I'm thinking there may be
 timing errors. Note that the exception is only logged to the console - not
 to the log file. Perhaps it occurs before the logging bundle is installed.

 I haven't seen this in previous versions of Karaf (2.1.0 and 1.6.0) but I've
 also added and changed a lot of bundles in addition to upgrading to Karaf
 2.1.2. Thus I don't know for sure if this is a problem specific to Karaf
 2.1.2.

 /Bengt



-- 
Cheers,
Guillaume Nodet

Blog: http://gnodet.blogspot.com/

Open Source SOA
http://fusesource.com


Re: Startup problems: javax.naming.NoInitialContextException: Unable to determine caller'sBundleContext

2010-11-30 Thread Bengt Rodehav
JIRA created:

https://issues.apache.org/jira/browse/KARAF-304

/Bengt

2010/11/30 Guillaume Nodet gno...@gmail.com

 This exception comes from the aries jndi bundle it seems.
 I've tested various combinations of karaf and aries jndi, but all seem
 to have this behavior.
 COuld you please raise a JIRA issue ?
 I'm not sure yet, but I suspect the problem is in the aries jndi bundle.

 On Tue, Nov 30, 2010 at 08:56, Bengt Rodehav be...@rodehav.com wrote:
  I use Karaf 2.1.2. On a clean startup (the data directory is empty)
  everything works OK. However, when I restart Karaf (without cleaning out
 the
  data directory) I consistently get the following exception:
 
  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
 
  Does anyone have any idea what could be wrong? I'm thinking there may be
  timing errors. Note that the exception is only logged to the console -
 not
  to the log file. Perhaps it occurs before the logging bundle is
 installed.
 
  I haven't seen this in previous versions of Karaf (2.1.0 and 1.6.0) but
 I've
  also added and changed a lot of bundles in addition to upgrading to Karaf
  2.1.2. Thus I don't know for sure if this is a problem specific to Karaf
  2.1.2.
 
  /Bengt



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