1/ When you start the NamingService for the first time, with no Context.INITIAL_CONTEXT_FACTORY property, everything works fine. The default value is null. 2/ When you stop the NamingService, the property is then "", and not null. 3/ If you want to restart the NamingService, the "oldValue" isn't null and so it's used. So, the NamingService doesn't start. This is my solution, in the start method: oldValue = System.getProperty(Context.INITIAL_CONTEXT_FACTORY); if (oldValue != null >>>>>>>> && oldValue.length() > 0 <<<<<<<<<) { oldIcValue = oldValue; } else { System.setProperty(Context.INITIAL_CONTEXT_FACTORY, Constants.Package + ".java.javaURLContextFactory"); } Now, when you start + stop + start the NamingService, the service works fine. Frederic
Done as suggested. Thanks ;)