I have a method that converts JPEGS to thumbnails.
During that conversion, it first calls:
ImageIcon.getImage(<path to file>
;
This code runs great locally on
Tomcat, but on the web server, the very first getImage() line of code causes some kind of exception (because all my debug statements fail after this first ImageIcon.getImage() call).
The web server is using the same version of Tomcat and has the same lib files I'm using.
The import statements in my
java program include:
import java.awt.Image;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;
import java.io.*;
import java.io.FileOutputStream;
import javax.swing.ImageIcon;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
Does anybody have an idea why the ImageIcon.getImage() might fail?
I'm using full paths to the image using ServletContext() method calls -- like this:
fullPathToPics = getServletContext().getRealPath("/picturesDirectories/pics");
Thanks in advance for any help or ideas.
-- Mike