File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes ImageIcon.getImage() not working on server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "ImageIcon.getImage() not working on server" Watch "ImageIcon.getImage() not working on server" New topic
Author

ImageIcon.getImage() not working on server

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 867
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
 
 
subject: ImageIcon.getImage() not working on server
 
Threads others viewed
Connecting to Visibroker server from Tomcat
Server for EJB...with Tomcat?
RMI marshalling arguments error
Problem starting servlet
deploying a jsp
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture