sofastack / sofa-hessian

An internal improved version of Hessian3/4 powered by Ant Group CO., Ltd.
Apache License 2.0
141 stars 52 forks source link

Hessian serialization problem #52

Closed wavesZh closed 4 years ago

wavesZh commented 4 years ago

泛化序列化的例子里面, 如果将 Hessian2Output 和 Hessian2Input 换成 HessianOutput 和 HessianInput,程序会执行失败:

Exception in thread "main" com.caucho.hessian.io.HessianProtocolException: unknown code:￿
    at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1717)
    at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1203)
    at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:221)
    at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:161)
    at com.caucho.hessian.io.SerializerFactory.readMap(SerializerFactory.java:380)
    at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1186)
       ... ... 

是否限制了只能使用 Hessian2 呢?

com.alipay.sofa:hessian 版本 = 3.3.7

sofastack-bot[bot] commented 4 years ago

Hi @wavesZh, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

In the [Generalization Serialization] (https://github.com/sofastack/sofa-hessian/wiki/UserGuide# generalization serialization) example, if you replace Hessian2Output and Hessian2Input with HessianOutput and HessianInput, the program execution fails. : `Exception in thread" main "com.caucho.hessian.io.HessianProtocolException: unknown code: � at com.caucho.hessian.io.HessianInput.error (HessianInput.java:1717) at com.caucho.hessian. io.HessianInput.readObject (HessianInput.java:1203) at com.caucho.hessian.io.JavaDeserializer.readMap (JavaDeserializer.java:221) at com.caucho.hessian.io.JavaDeserializer.readMap (JavaDeserializer.java:161) at com.caucho.hessian.io.SerializerFactory.readMap (SerializerFactory.java:380) at com.caucho.hessian.io.HessianInput.readObject (HessianInput.java:1186) ... ... Is there a restriction? Can only use Hessian2? com.alipay.sofa: hessian version = 3.3.7

ujjboy commented 4 years ago

是的,只支持了 Hessian2 协议。