异常:java.io.StreamCorruptedException:无效类型代码:00 [英] Exception: java.io.StreamCorruptedException: invalid type code: 00
本文介绍了异常:java.io.StreamCorruptedException:无效类型代码:00的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我通过 EJB 接口查询实体时,在控制台下是可以的,但是从 Swing 切换到查询时会抛出此异常.
When I query through the EJB interface for a entity, under the console it is ok, but switch to query from Swing it throw this exception.
例外:
java.rmi.UnmarshalException: failed to unmarshal MY_ENTITY****; nested exception is:
java.io.StreamCorruptedException: invalid type code: 00
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:219)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
at ***.****_6ndxy4_EOImpl_922_WLStub.getProductInformation(Unknown Source)
at MY_CLASS****.getProductInformation(*****.java:460)
at ******$5.run(OrigBlotter.java:318)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.StreamCorruptedException: invalid type code: 00
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1642)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:217)
推荐答案
事实证明这是一个 JRE 错误.因为我的控制台环境是 1.5,而摆动是 1.6:
It turns out it is a JRE bug. As my console env is 1.5 and swing is 1.6:
错误参考:
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6554519
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149
我们需要将此参数传递给JVM
We need to pass this argument to the JVM
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dsun.lang.ClassLoader.allowArraySyntax=true
这篇关于异常:java.io.StreamCorruptedException:无效类型代码:00的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文