JAI problem.

From: Kocheralkota Harikrishna (kocheralkota.harikrishna_at_alcatel.com)
Date: 09/14/04


Date: Tue, 14 Sep 2004 09:31:04 +0530

Hello,
Following sample code works fine with windows and fails in UNIX.

it gives me the error
WARNING: Could not create system preferences directory. System
preferences are unusable.
Sep 14, 2004 2:41:32 PM java.util.prefs.FileSystemPreferences
checkLockFile0ErrorCode
WARNING: Could not lock System prefs.Unix error code 0.
Sep 14, 2004 2:41:32 PM java.util.prefs.FileSystemPreferences syncWorld
WARNING: Couldn't flush system prefs:
java.util.prefs.BackingStoreException: Couldn't get file lock.

and the image is not displayed

Your help is appreciated.

Thanks and best regards
hari

*******code starts*******
import java.awt.Frame;
import java.awt.Image;
import java.awt.Toolkit;
import javax.media.jai.JAI;
import javax.media.jai.RenderedOp;
import javax.media.jai.widget.ScrollingImagePanel;

public class AWTImageSample {

    public static void main(String args[]) {
        if (args.length != 1) {
            System.out.println("Usage: java AWTImageSample
jpg/gif_file_name");
            System.exit(0);
        }

        Image awtImage =
            Toolkit.getDefaultToolkit().getImage(args[0]);
        RenderedOp image = JAI.create("AWTImage", awtImage);

        ScrollingImagePanel panel =
            new ScrollingImagePanel(image, 300, 200);

        Frame window = new Frame("AWTImage Sample");
        window.add(panel);
        window.pack();
        window.show();
    }
}
******code ends*******



Relevant Pages

  • Re: JAI problem.
    ... > Following sample code works fine with windows and fails in UNIX. ... > WARNING: Could not create system preferences directory. ... http://reader.imagero.com Java image reader ...
    (comp.lang.java.gui)
  • Native JDK with libthr/libkse
    ... WARNING: Could not lock System prefs.Unix error code 136418560. ... WARNING: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock. ...
    (freebsd-current)
  • Re: Native JDK with libthr/libkse
    ... Could not create system preferences directory. ... > WARNING: Could not lock System prefs.Unix error code 136418560. ...
    (freebsd-current)
  • Re: Warning missing?
    ... > I would expect a warning like that: in my sample code the argument type ... > is missing in the function. ... If you want a warning about the absence of a prototype, ... Prev by Date: ...
    (comp.lang.c)
  • Re: Please explain JDK 1.5 generic type warning
    ... code to eliminate the warning. ... Sample code: ... Type safety: The cast from Object to ArrayListis actually ... The problem is unavoidable with readObject, so I suggest writing a small method to wrap up the nastiness in. ...
    (comp.lang.java.programmer)