问题描述
我有两个与Jai一起工作的类似项目,一个在从jai_core.jar库中调用RenderedOp类时平稳运行,而另一个则停止,并说找不到类OperationRegistrySpi.
I have two similar projects working with Jai and one runs smoothly while the other stops when calling RenderedOp class from the jai_core.jar library, saying that it can't find the class OperationRegistrySpi.
两个类.
RenderedOp imagen = JAI.create("stream",imgTif ); //This line throws the exception
日志如下:
GRAVE: >>java.lang.NoClassDefFoundError: javax/media/jai/OperationRegistrySpi
>>java.lang.ClassNotFoundException: javax.media.jai.OperationRegistrySpi
>> at java.net.URLClassLoader$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClassCond(Unknown Source)
>> at java.lang.ClassLoader.defineClass(Unknown Source)
>> at java.security.SecureClassLoader.defineClass(Unknown Source)
>> at java.net.URLClassLoader.defineClass(Unknown Source)
>> at java.net.URLClassLoader.access$000(Unknown Source)
>> at java.net.URLClassLoader$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1595)
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at com.sun.media.jai.util.Service$LazyIterator.next(Service.java:267)
>> at javax.media.jai.OperationRegistry.registerServices(OperationRegistry.java:2047)
>> at javax.media.jai.ThreadSafeOperationRegistry.registerServices(ThreadSafeOperationRegistry.java:612)
>> at javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:365)
>> at javax.media.jai.JAI.<clinit>(JAI.java:560)
我已经配置了构建路径,并且工作项目和越野车的jar文件位置相同.
I have configured the Build Path and the jar file location is the same for the working project and the buggy one.
我正在使用Eclipse.
I'm on Eclipse.
推荐答案
我可以通过删除与Jai相关的所有jar文件(jai-core和jai-codec)并重新安装jai-1_1_2_01-lib-windows-来解决此问题.找到了i586-jre.exe软件包此处.
I could solve it by deleting all the jar files related to Jai (jai-core and jai-codec) and reinstalling the jai-1_1_2_01-lib-windows-i586-jre.exe package found here.
问题是我缺少Jai安装随附的mlibwrapper_jai.jar.
The problem was that I was missing the mlibwrapper_jai.jar that comes with the installation of jai.
这篇关于ClassNotFoundException javax.media.jai.OperationRegistrySpi,但是该类在那里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!