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

Uncaught error fetching image

21 views
Skip to first unread message

Yuffie

unread,
Dec 20, 2001, 9:48:53 AM12/20/01
to
Hi,

I'm using a java program to create thumbnails for online images.
I encountered the following at runtime:

Uncaught error fetching image:
java.lang.SecurityException: image moved!
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(RuntimeException.java:47)
at java.lang.SecurityException.<init>(SecurityException.java:39)
at sun.awt.image.URLImageSource.getDecoder(Compiled Code)
at sun.awt.image.InputStreamImageSource.doFetch(Compiled Code)
at sun.awt.image.ImageFetcher.fetchloop(Compiled Code)
at sun.awt.image.ImageFetcher.run(Compiled Code)

Any idea what causes this and how to prevent it?
Thank you.

Paul Lutus

unread,
Dec 20, 2001, 1:18:48 PM12/20/01
to
"Yuffie" <yuf...@lycosasia.com> wrote in message
news:191C91BDFE8ED411B844...@pfs21.ex.nus.edu.sg...

It would be something in your code, the code you didn't post.

--
Paul Lutus
www.arachnoid.com


Yuffie

unread,
Dec 21, 2001, 12:35:00 AM12/21/01
to
> It would be something in your code, the code you didn't post.

public JpegEncoder(Image image, int quality, OutputStream out) throws
Exception
{
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(image, 0);
try {
tracker.waitForID(0);
}
catch (InterruptedException e) {;}
.....


It's working fine before tracker.waitForID(0).

Paul Lutus

unread,
Dec 21, 2001, 1:06:48 AM12/21/01
to
"Yuffie" <yuf...@lycosasia.com> wrote in message
news:191C91BDFE8ED411B844...@pfs21.ex.nus.edu.sg...

Post a small, complete, working code example.

--
Paul Lutus
www.arachnoid.com


Jim Sculley

unread,
Dec 21, 2001, 12:43:03 PM12/21/01
to
Paul Lutus wrote:


How praytell does client code cause a SecurityException in a sun.awt.*
class? Well, the answer is that it doesn't.

If you don't know the answer to a question, or don't want to bother to
spend the five minutes required to investigate the problem, just ignore
the post and move on to the next one. Telling everyone and his brother
that the problem is in their code isn't helpful, and, in this case (and
others), is 100% incorrect.

To the original poster:

This problem occured in Java versions prior to 1.3. The error is in the
URLImageSource.getDecoder() method which was improperly using object
identity (as opposed to String equivalence) to compare host name
Strings. The bug is listed as fixed in version 1.3. I presume that you
are using an older version which is why you are seeing this error.

Jim S.

Yuffie

unread,
Dec 21, 2001, 11:43:58 PM12/21/01
to
Yes, I'm using Java 1.2.
Thanks for your help.
0 new messages