Help with Weird Fatal Error

I

Ivar

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
 
A

Andrew Thompson

Ivar said:
...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?
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.
 
I

Ivar

Andrew said:
Using another image? Did you retry the other computers
(or another computer) using the same image causing a problem?


..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.

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

Andrew Thompson

(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.
 
K

Knute Johnson

Ivar said:
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

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

Ivar

Knute said:
Ivar said:
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

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top