Java JPG编解码器不起作用

时间:2014-06-11 14:50:54

标签: java tomcat grails grails-plugin jai

我的tomcat应用程序有问题,在更改服务器并安装最新版本的tomcat7后,我的应用程序将无法读取/加载jpg文件..

我在服务器上安装了imageio和jai,尝试更改java版本,但每次我都有相同的错误..

有人有想法吗?

Error: One factory fails for the operation "jpeg" 
Occurs in: javax.media.jai.ThreadSafeOperationRegistry 
java.lang.reflect.InvocationTargetException 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
        at java.lang.reflect.Method.invoke(Method.java:606) 
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122) 
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674) 
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473) 
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332) 
        at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:102) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
        at java.lang.reflect.Method.invoke(Method.java:606) 
        at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122) 
        at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674) 
        at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473) 
        at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332) 
        at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819) 
        at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867) 
        at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2179) 

可以在此处找到整个错误日志 - > http://paste.ubuntu.com/7653452/

更新:问题与名为ImageTools的Grails插件有关

1 个答案:

答案 0 :(得分:2)

如果您查看JPEGImageDecoder的代码,您会看到它的导入取决于com.sun.image.codec.jpeg.ImageFormatException

然而,com.sun.image.codec.jpeg was removed from Java 7 onwards.

问题很可能是JAI只是过时了,你必须使用Java 6运行时才能使用它。