小弟这两天预遇到一个奇怪的问题。在WELOGIC10 JDK1.6上部署了一个远程的EJB,EJB接口里返回一个LIST对象,LIST里有一个DTO。
代码如下
public class OneDTO implements serialization { private SimpleDateFormat fmt=new SimpleDateFormat("yyyyMMdd");
public getFmt(){
return fmt;
}
public setFmt(SimpleDateFormat fmt){
return this.fmt=fmt;
}
}在本地用JDK1.4写单元测试CALL的时候报如下错误
java.rmi.UnmarshalException: failed to unmarshal interface java.util.List; nested exception is:
java.io.StreamCorruptedException
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:161)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)本地更换为1.6以上的版本就OK。因为在生产环境是两个不同版本的关联系统互调,无法同时升级为统一版本。各位大侠是否遇到类似问题。
代码如下
public class OneDTO implements serialization { private SimpleDateFormat fmt=new SimpleDateFormat("yyyyMMdd");
public getFmt(){
return fmt;
}
public setFmt(SimpleDateFormat fmt){
return this.fmt=fmt;
}
}在本地用JDK1.4写单元测试CALL的时候报如下错误
java.rmi.UnmarshalException: failed to unmarshal interface java.util.List; nested exception is:
java.io.StreamCorruptedException
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:161)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:285)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)本地更换为1.6以上的版本就OK。因为在生产环境是两个不同版本的关联系统互调,无法同时升级为统一版本。各位大侠是否遇到类似问题。
这个一般是因为jar的编译版本不一样,也是就是jdk不一样,写单元测试时要使用相同版本的JDK。