I have servlet in my web application that serves images, and when I visit those urls with browser images are server correctly. Then I have this other servlet that resizes images, idea is to visit get image by url in resize servlet and then resize image. But for some reason all following methods return null, but when I visit given url with browser, image is shown correctly.
URL imageURL = new URL(fullUrl);
// Case 1
RenderedImage img = ImageIO.read(imageURL);
// Case 2
BufferedImage img = JAI.create("url", imageURL).getAsBufferedImage();
// Case 3
Image img = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(imageURL);