On Fri, 4 May 2001, Kevin Jones wrote:
> I can't get servlet re-loading to work in TC4b3. Looking at the code -
>
> Loader creates a thread that sleeps until the time set in server.xml
> expires. This thread calls StandardClassLoader.modified
>
> The modified call checks the classCache to see if there are any entries
> (code is here)
>
> if (classCache.size() < 1)
> {
> return (false);
> }
>
> Checking through the code classes are added to the cache in the loadClass
> function.
>
> Near the end of that function is this code
>
> try
> {
> File file = new File(pathname);
> if (file.exists() && file.canRead())
> {
> if (debug >= 3)
> {
> log(" Caching from '" + file.getAbsolutePath() +
> "' modified '" +
> (new java.sql.Timestamp(file.lastModified())) +
> "'");
> }
> classCache.put(name, new ClassCacheEntry(clazz, file,
> file.lastModified()));
> }
> } catch(AccessControlException ace)
>
> Printing out the value of 'pathname' just before this code executes gives
>
> "jndi:/localhost/AddressBook/WEB-INF/classes\com\develop\ewebjava\lab\Browse
> .class",
>
> which means that the 'file' doesn't exist and so doesn't get added to the
> cache.
>
> Should that 'jndi:/localhost' be there ?
>
> This is with the latest nightly build BTW,
>
By "latest", do you mean 20010503? The reason I ask is that Remy made
some changes yesterday that would have shown up in the 20010504 build, and
these changes fixed class reloading at least for the use case reported in
the bug report (i.e. load one of the example app servlets, then recompile
it). The changes were specifically in the code area you describe above.
> Kevin Jones
> DevelopMentor
> www.develop.com
>
>
Craig