Details
Description
When using Jetty in an embedded manner with no extraction of war files, Jetty has a array index exception when trying to use the fill method within ResourceCache. I have not been able to reproduce this problem when simply using the out of the box jetty. The following code shows the problem that I am seeing.
protected void fill(Content content)
throws IOException
I've attached a patch that addresses the problem, but I don't believe that it handles the root of the problem. For some reason, the length in ResourceCache.java:146 returns the correct value, but the fill method sometimes returns -1.
Well the ResourceCache is one of my least favourite parts of Jetty. It is rather ugly.
I can't see why that length should be -1? It could be that the resource is being released
from the cache just as you try to use it. So I am not sure if ignoring the -1 is the
right thing to do.
I may try to remake the resource if it returns -1 and see if that makes a difference.
if not, I will still throw an exception