1

我在上传 JPEG 时遇到了这个奇怪的异常。PNG工作正常。

play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.NoSuchMethodError: skipInputBytes]]
    at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.1]
    at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.1]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$handleAction$1$4$$anonfun$apply$28.apply(PlayDefaultUpstreamHandler.scala:403) [play_2.10.jar:2.1.1]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$handleAction$1$4$$anonfun$apply$28.apply(PlayDefaultUpstreamHandler.scala:403) [play_2.10.jar:2.1.1]
    at scala.Option.map(Option.scala:145) [scala-library.jar:na]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$handleAction$1$4.apply(PlayDefaultUpstreamHandler.scala:403) [play_2.10.jar:2.1.1]
java.lang.RuntimeException: java.lang.NoSuchMethodError: skipInputBytes
    at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:222) ~[play_2.10.jar:2.1.1]
    at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:109) ~[play_2.10.jar:2.1.1]
    at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:109) ~[play_2.10.jar:2.1.1]
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[play_2.10.jar:2.1.1]
    at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:108) ~[play_2.10.jar:2.1.1]
    at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:106) ~[play_2.10.jar:2.1.1]
Caused by: java.lang.NoSuchMethodError: skipInputBytes
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.initReaderIDs(Native Method) ~[na:1.7.0_15]
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.<clinit>(JPEGImageReader.java:91) ~[na:1.7.0_15]
    at com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:85) ~[na:1.7.0_15]
    at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320) ~[na:1.7.0_15]
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529) ~[na:1.7.0_15]
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513) ~[na:1.7.0_15]

我什至不知道它在我的代码中到底出现在哪里。有任何想法吗?

4

1 回答 1

1

我对此进行了一些调查。和你一样,我也安装了 1.7.0_15。JPEGImageReaderJDK附带,所以我检查了来源。方法skipInputBytes不存在。然后我在这里安装了 JDK 1.7.0_21 方法包含在JPEGImageReader.

因此,您只需安装新的 JDK,或者配置您的 IDE 以使用它(如果您已经安装了它)。

于 2013-04-26T06:50:29.107 回答