Hi,
I am currently using Vaadin beta 9 to build up a image gallery prototype. Everything works fine but I get randomly for some images the following:
com.vaadin.server.GlobalResourceHandler error
WARNING: /APP/global/0/legacy/185/record23992.png is not a valid global resource path
I am creating the different Embedded instances to add to the CssLayout container with:
public class ThumbnailEmbedded extends Embedded
{
private Item item;
public ThumbnailEmbedded (Item item)
{
super ();
this.item = item;
setType(TYPE_IMAGE);
}
@Override
public Resource getSource ()
{
final StreamResource streamResource = new StreamResource (new StreamResource.StreamSource ()
{
public InputStream getStream ()
{
return new ByteArrayInputStream (item.getPictureValue ().getAsJPEG (120));
}
}, "record" + item.getID () + ".png");
streamResource.setCacheTime (0);
return streamResource;
}
@Override
public String getMimeType() {
return "image/png";
}
}
I tried to have a look on the source code of the GlobalResourceHandler and it seems that the exception occurs when the request path doesn’t contain a “key”.
But the request path of the images is the same for all (just the id changes) and this exception happens quite random and not often.
Any ideas?