What does "network: Cache entry not found [url: ...]" mean exactly?

ezze picture ezze · Feb 28, 2012 · Viewed 9.2k times · Source

Shortly

I cannot figure out what is the common reason of network: Cache entry not found [url: ...] message's appearence in Java console during applet running in web browser. I've get that this one can appear when performing with java.net.URLConnection (requesting some data from the Internet) but still don't know about its any possible reasons to look for to investigate my particular problem. So my questions are: what are possible reasons of this message and can this affect application's normal run? Finally, what is the cache and can I control it somehow?

In detail

It will be too difficult and unnecessary to post big code snippets so I'll try to describe the problem as simplier as possible.

I am building an applet based on NASA WorldWind and facing a very strange behavior when requesting tiled image layers calling corresponding applet's method from JavaScript. Tiled image layer is a layer that can overlay 3D Earth and consisting of sets of fixed-size pictures (tiles) which are to be requested separately during layer's loading (suppose, layer is something like a puzzle of tiles :). That's why each tile's request has its own thread.

Initially I had an AccessControllerException due to each tile request thread had no permissions to make crossdomain requests and read/save load results to local file cache. This problem has been solved by wrapping tile request's actual code by

AccessController.doPrivileged(new PrivilegedAction() {

    @Override
    public Object run() {

        // Requesting tile and performing with the result...
        // ...
    }
});

As the result, I see that tiles are loaded and stored in local file cache directory. But I still don't see the layer on the Earth. The fact is that I get the following network messages in Java console:

network: Cache entry not found [url: http://caches.scanex.ru/getTile.cgi?T=BMNG-01-2004&L=0&X=4&Y=1, version: null]
network: Connecting http://caches.scanex.ru/getTile.cgi?T=BMNG-01-2004&L=0&X=4&Y=1 with proxy=HTTP @ /192.168.4.10:8080

I was able to find a place in the code when these messages appear - when getting HTTP response code:

HttpURLConnection htpc = (HttpURLConnection)fconnection;
responseCode = htpc.getResponseCode();

Then, I found out that java.net.URL instance provided for URLConnection and other preparations are also made in another thread. To be precise, tile's download goes through the following threads' chain where each child thread is represented by java.util.concurrent.FutureTask:

Layer's rendering thread >> Tile request task where URL is to be prepared basing on existing local cache data >> Reading tile contents and handling the result (storing in local cache if it's required (it's where above network messages occur).

Finally, I granted privileges for all these threads with AccessController.doPrivileged(...) construction, and I can see the desired result - tiled image layers are overlayed. But I'm still confused by Cache entry not found messages 'cause they are left in Java console and appear for each requested tile. That's why I want to know: is such behavior normal, and what do these messages actually mean?

P.S. For interested people - http://caches.scanex.ru doesn't work from outside at the moment.

Answer