本帖最后由 ◇半度微凉 于 2011-12-9 23:18 编辑
大家好!帮忙看看这个问题!前段时间小弟自学J2ME手机游戏开发之后,自己编写了一个手机小游戏!但是用WTK 2.5.2模拟器运行会抛出以下异常,非常迷惑!虽然自己也处理过不少异常,但这个异常还是第一次碰见!如果说是我自己处理的png图片有问题的话,但是用另一款模拟器KEmulator 1.00运行的话,却能正常运行,一个异常都没有!包括最下面那两个空指针异常也消失了!到底怎么回事儿?小弟百思不得其解!请各位高人指点一下!
Running with storage root C:\Documents and Settings\Administrator\j2mewtk\2.5.2\appdb\MediaControlSkin
Running with locale: Chinese_People's Republic of China.936
Running in the identified_third_party security domain
java.io.UTFDataFormatException: malformed input around byte 714
at java.io.DataInputStream.readUTF(Unknown Source)
at javax.imageio.stream.ImageInputStreamImpl.readUTF(Unknown Source)
at com.sun.kvem.png.PNGImageReader.parse_iTXt_chunk(PNGImageReader.java:447)
at com.sun.kvem.png.PNGImageReader.readMetadata(PNGImageReader.java:650)
at com.sun.kvem.png.PNGImageReader.readImage(PNGImageReader.java:1312)
at com.sun.kvem.png.PNGImageReader.read(PNGImageReader.java:1582)
at com.sun.kvem.midp.GraphicsBridge.loadImage(GraphicsBridge.java:2602)
at com.sun.kvem.midp.GraphicsBridge.createImageFromData(GraphicsBridge.java:2511)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.kvem.sublime.MethodExecution.process(MethodExecution.java:42)
at com.sun.kvem.sublime.SublimeExecutor.processRequest(SublimeExecutor.java:63)
at com.sun.kvem.sublime.SublimeExecutor.run(SublimeExecutor.java:25)
loadImage error
startApp threw an Exception
java.lang.NullPointerException
java.lang.NullPointerException
at role.Role.<init>(+517)
at role.Solder.<init>(+6)
at map.Map.<init>(+117)
at GameMain.<init>(+56)
at GameMidlet.startApp(+44)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)
Execution completed.
3474582 bytecodes executed
43 thread switches
1706 classes in the system (including system classes)
21456 dynamic objects allocated (2079824 bytes)
35 garbage collections (928672 bytes collected) |
|