Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with Weird Fatal Error

14 views
Skip to first unread message

Ivar

unread,
Dec 1, 2006, 11:51:54 PM12/1/06
to
Hi guys, so basically I have the following seemingly innocuous code
(which did not give me mistakes before on another computer, but I got
the latest install of Eclipse and am running this)

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import java.io.IOException;

public class testImageClass {
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
BufferedImage image = image = ImageIO.read(new File("C:\\Documents
and Settings\\Owner\\My Documents\\My Pictures\\66323.jpg")); //This is
line 15
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}

When I am running the above code, I get the following error:

sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageWriterSpi:
Provider com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriterSpi
not found
at sun.misc.Service.fail(Unknown Source)
at sun.misc.Service.access$000(Unknown Source)
at sun.misc.Service$LazyIterator.next(Unknown Source)
at
javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown
Source)
at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at javax.imageio.ImageIO.<clinit>(Unknown Source)
at testImageClass.main(testImageClass.java:15)
Exception in thread "main"

Any idea what could be throwing this fatal exception? I would
appreciate your guys help/input...

Thanks,
R

Andrew Thompson

unread,
Dec 2, 2006, 12:27:06 AM12/2/06
to
Ivar wrote:
> ...I have the following seemingly innocuous code

> (which did not give me mistakes before on another computer,

Using another image? Did you retry the other computers
(or another computer) using the same image causing a problem?
<snip>

> BufferedImage image = image = ImageIO.read(new File("C:\\Documents
> and Settings\\Owner\\My Documents\\My Pictures\\66323.jpg")); //This is

..a very fragile way to build a path to the image, one
good way is to use the File(File, String) constructor
iteratively for each directory.

(but no, a FileNotFound is apparently not the problem
in this instance - I suggest looking to the format
and integrity of the JPEG(s) that cause that error..)

Andrew T.

Ivar

unread,
Dec 2, 2006, 12:29:29 AM12/2/06
to

I tried with more than one image but still am getting the same error.
I've even replicated this error on another machine...

Andrew Thompson

unread,
Dec 2, 2006, 12:44:00 AM12/2/06
to
Ivar wrote:
> Andrew Thompson wrote:
> > Ivar wrote:
> > > ...I have the following seemingly innocuous code
> > > (which did not give me mistakes before on another computer,
> >
> > Using another image? Did you retry the other computers
> > (or another computer) using the same image causing a problem?
> > <snip>

(please trim text no longer relevant)

> I tried with more than one image but still am getting the same error.
> I've even replicated this error on another machine...

So it is 'all images, all machines' at the moment?

I just tried the small JPG image shown here..
<http://www.javasaver.com/testjs/jmf/moonphase-64x64.jpg>
..it works just fine on this PC (Java 1.5.something) with
the code you provided.

Try that image.

Andrew T.

Knute Johnson

unread,
Dec 2, 2006, 7:19:34 PM12/2/06
to

The error complains about an ImageWriter and the code you show is
reading an image? What compiler and do you also have JAI installed?

--

Knute Johnson
email s/nospam/knute/

Ivar

unread,
Dec 3, 2006, 8:32:11 AM12/3/06
to

Hmm...what solved the problem was I re-installed JAI..thanks!

0 new messages