I have the following problem:
I created the servlet which should draw a dynamic graph. During the drawing process it should fetch the picture from another directory and to draw it upon another image. Everything should work fine:
try {
BufferedImage temp = ImageIO.read(new File("image/arrow.png"));
tempIm = temp.getScaledInstance(55, 55, Image.SCALE_SMOOTH);
} catch (IOException e) {
e.printStackTrace();
}
But it prints the following:
SEVERE: javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1275)
at CertificateDraw.doGet(CertificateDraw.java:36)
I tried to change the path of the File object in all possible ways it just gives the same problem even though the part of the image is still sent to the browser. So the problem is with the ImageIO.read part - how can I find why it does not load the image?!
I am working in Eclipse - servlet is in the src folder. The image is in "image" folder under the rot directory "WebContent".