Sorry about the cross post!
Anyway, I have an applet that sends an Image to a Servlet. The Servlet is
then supposed to save the Image out as a JPEG file. The applet to servlet
transfer works fine. Here's a code snippet from the servlet:
Image image; // obtained elsewhere
FileOutputStream out = new FileOutputStream("c:\\image.jpg");
ImageEncoder encoder =
ImageCodec.createImageEncoder("JPEG", out, new JPEGEncodeParam());
encoder.encode((BufferedImage) image);
out.flush();
out.close();
(all of this is in a try block.)
I'm getting a FileNotFoundException within the call to
ImageCodec.createImageEncoder (verified by bracketing the call with
println's). If I put an out.close() after the call to the FileOutputStream
constructor, the file gets created, so it's not a security issue.
My configuration: Windows 98, Internet Explorer 5. Java Web Server 2.0. I've
set my PATH variable to include the JAI installation's "lib" directory, and
I've also copied the JAI .dll's and .jar's into the Java Web Server's "lib"
directory for good measure.
The exception is actually reported in the Java Console window for the
browser the applet is running in, but bracketing each statement in both the
applet and the servlet shows that the exception definitely occurring in the
call to ImageCodec.createImageEncoder.
Any ideas? Thanks!
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html