Error: Could not find mediaLib accelerator wrapper classes. Continuing in pure Java mode.
Occurs in: com.sun.media.jai.mlib.MediaLibAccessor
java.lang.NoClassDefFoundError: com/sun/medialib/mlib/Image
at com.sun.media.jai.mlib.MediaLibAccessor$1.run(MediaLibAccessor.java:248)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.media.jai.mlib.MediaLibAccessor.setUseMlib(MediaLibAccessor.java:245)
at com.sun.media.jai.mlib.MediaLibAccessor.useMlib(MediaLibAccessor.java:177)
at com.sun.media.jai.mlib.MediaLibAccessor.isMediaLibCompatible(MediaLibAccessor.java:357)
at com.sun.media.jai.mlib.MediaLibAccessor.isMediaLibCompatible(MediaLibAccessor.java:315)
at com.sun.media.jai.mlib.MlibScaleRIF.create(MlibScaleRIF.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
...etc.
A good cure for this is to get the stuff it would like to have installed. But if you can't do that, or can't predict something about the target hardware, there's a nice way to get the exception ignored.
JAI includes a listener for imaging errors. Create an instance of such a listener and add it to your JAI default instance like so:
public class MyErrListener implements ImagingListener {
public boolean errorOccurred(String arg0,
Throwable arg1, Object arg2,
boolean arg3) throws RuntimeException {
// Do nothing.
return false;
}
}
and then...
JAI.getDefaultInstance().setImagingListener(new MyErrListner());Here's the relevant documentation:
http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/util/ImagingListener.html
http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/JAI.html#setImagingListener(javax.media.jai.util.ImagingListener)
No comments:
Post a Comment