Re: VERY IMPORTANT: Bug in getParent()

> Now, the get returns but the next get to the same resource or any other
> resource (including root) generates the following stack trace:
> 
> 
> GET /dds/coordinator.ashtml?Admin HTTP/1.0
> Connection: Keep-Alive
> Date: Mon, 27 Oct 1997 15:53:48 GMT
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Accept-Charset: iso-8859-1,*,utf-8
> Accept-Language: en
> Host: tiger
> Referer: http://tiger/dds/coordinator.ashtml
> User-Agent: Mozilla/4.03 [en] (WinNT; I)
> 
> +++ client-1(socket-clients:20) got exception:
> java.lang.NullPointerException:
>         at w3c.tools.store.AttributeHolder.getValue(AttributeHolder.java)
>         at w3c.tools.store.Resource.collectFrames(Resource.java)
>         at w3c.jigsaw.resources.FilteredResource.getFilters(FilteredResource.jav
> a)
>         at w3c.jigsaw.resources.ContainerResource.lookup(ContainerResource.java)
> 
>         at w3c.jigsaw.resources.StoreContainer.lookup(StoreContainer.java)
>         at w3c.jigsaw.http.httpd.perform(httpd.java)
>         at w3c.jigsaw.http.Client.processRequest(Client.java)
>         at w3c.jigsaw.http.Client.startConnection(Client.java)
>         at w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java)
>         at w3c.util.CachedThread.run(ThreadCache.java)
> w3c.jigsaw.http.ClientException:
>         at w3c.jigsaw.http.Client.startConnection(Client.java)
>         at w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java)
>         at w3c.util.CachedThread.run(ThreadCache.java)
> java.lang.NullPointerException:
>         at w3c.tools.store.AttributeHolder.getValue(AttributeHolder.java)
>         at w3c.tools.store.Resource.collectFrames(Resource.java)
>         at w3c.jigsaw.resources.FilteredResource.getFilters(FilteredResource.jav
> a)
>         at w3c.jigsaw.resources.ContainerResource.lookup(ContainerResource.java)
> 
>         at w3c.jigsaw.resources.StoreContainer.lookup(StoreContainer.java)
>         at w3c.jigsaw.http.httpd.perform(httpd.java)
>         at w3c.jigsaw.http.Client.processRequest(Client.java)
>         at w3c.jigsaw.http.Client.startConnection(Client.java)
>         at w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java)
>         at w3c.util.CachedThread.run(ThreadCache.java)

Here is the same thing with line numbers:


GET /dds/coordinator.ashtml?Admin HTTP/1.0
Connection: Keep-Alive
Date: Mon, 27 Oct 1997 18:14:09 GMT
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Accept-Charset: iso-8859-1,*,utf-8
Accept-Language: en
Host: tiger
Referer: http://tiger/dds/coordinator.ashtml
User-Agent: Mozilla/4.03 [en] (WinNT; I)

+++ client-1(socket-clients:20) got exception:
java.lang.NullPointerException:
        at w3c.tools.store.AttributeHolder.getValue(AttributeHolder.java:230)
        at w3c.tools.store.Resource.collectFrames(Resource.java:239)
        at w3c.jigsaw.resources.FilteredResource.getFilters(FilteredResource.jav
a:47)
        at w3c.jigsaw.resources.ContainerResource.lookup(ContainerResource.java:
93)
        at w3c.jigsaw.resources.StoreContainer.lookup(StoreContainer.java:409)
        at w3c.jigsaw.http.httpd.perform(httpd.java:1421)
        at w3c.jigsaw.http.Client.processRequest(Client.java:374)
        at w3c.jigsaw.http.Client.startConnection(Client.java:447)
        at w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java:114)
        at w3c.util.CachedThread.run(ThreadCache.java:86)
w3c.jigsaw.http.ClientException:
        at w3c.jigsaw.http.Client.startConnection(Client.java:509)
        at w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java:114)
        at w3c.util.CachedThread.run(ThreadCache.java:86)
java.lang.NullPointerException:
        at w3c.tools.store.AttributeHolder.getValue(AttributeHolder.java:230)
        at w3c.tools.store.Resource.collectFrames(Resource.java:239)
        at w3c.jigsaw.resources.FilteredResource.getFilters(FilteredResource.jav
a:47)
        at w3c.jigsaw.resources.ContainerResource.lookup(ContainerResource.java:
93)
        at w3c.jigsaw.resources.StoreContainer.lookup(StoreContainer.java:409)
        at w3c.jigsaw.http.httpd.perform(httpd.java:1421)
        at w3c.jigsaw.http.Client.processRequest(Client.java:374)
        at w3c.jigsaw.http.Client.startConnection(Client.java:447)
        at w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java:114)
        at w3c.util.CachedThread.run(ThreadCache.java:86)


The only way that the null pointer exception is generated is by the
'values' member being null.  This means that the root resource was unloaded.

From what I see, one possible solution is to make the httpd class implement
ResourceLocker and set the 'root' member variable to null when notified that
root is unloaded.

I`m not sure this will help with the parent/child ancestory issue.  It
would make more sense to require the parent to be loaded as long as the
child is loaded--including the root.

==============================================================================
R. Alexander Milowski     http://www.copsol.com/   alex@copsol.com
Copernican Solutions Incorporated                  (612) 379 - 3608

Received on Monday, 27 October 1997 13:29:35 UTC