Closed Aliece closed 5 years ago
具体异常信息是这样Caused by: com.caucho.hessian.HessianException: jar:file:xxxxxx/lib/hessian-4.0.38.jar!/META-INF/hessian/serializers: com.caucho.hessian.io.LocaleSerializer is invalid because it does not implement com.caucho.hessian.io.Serializer
at com.caucho.hessian.io.ContextSerializerFactory.initSerializerFiles(ContextSerializerFactory.java:381) ~[hessian-4.0.38.jar:?]
at com.caucho.hessian.io.ContextSerializerFactory.init(ContextSerializerFactory.java:289) ~[hessian-4.0.38.jar:?]
at com.caucho.hessian.io.ContextSerializerFactory.
@Aliece 麻烦补充下问题复现 Demo.
@Aliece 麻烦补充下问题复现 Demo.
@Aliece 上传的 demo 解压有问题哈,能否直接给个git 地址
@Aliece 上传的 demo 解压有问题哈,能否直接给个git 地址
@Aliece 个人认为这是 Hessian 4.0.2 兼容性问题,只有在 IDE 启动时会报错,java -jar 启动不会报错。另外如果将 hessian 降低到 3.x 版本,也没有报错。
@QilongZhang 请问您使用java -jar启动是启动了xxx-executable-ark.jar么
@QilongZhang 请问您使用java -jar启动是启动了xxx-executable-ark.jar么
是的
关注 https://github.com/alipay/sofa-hessian/issues/38 , 计划在 sofa-hessian 4.0.3 兼容这个问题。
Describe the bug
A clear and concise description of what the bug is.
Expected behavior
Actual behavior
Steps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
java -version
):1.8uname -a
):IDE version:
public T fromBytes(byte[] dat, Type type) throws Exception {
Hessian2Input input = null;
try {
input = new Hessian2Input(new ByteArrayInputStream(dat));
return (T) input.readObject();
} finally {
if (input != null) {
input.close();
}
}
}
使用上述依赖启动后调用hessian的序列化和反序列化的时候会出现加载序列化类的时候由于classloader不一样导致加载类失败,应该是BizClassloader没有设置parent导致的 希望能帮忙解决一下