Bug 30561 - NamingService doesn't correctly start/stop
Summary: NamingService doesn't correctly start/stop
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.0.27
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-10 15:42 UTC by Frédéric Mascaro
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Mascaro 2004-08-10 15:42:16 UTC
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
Comment 1 Yoav Shapira 2004-08-21 12:28:49 UTC
Done as suggested.  Thanks ;)