fix #210 JavaDeserializer._constructor.newInstance([null, null]) NPE#1608
fix #210 JavaDeserializer._constructor.newInstance([null, null]) NPE#1608takeseem wants to merge 1 commit intoapache:masterfrom
Conversation
bd3d0e5 to
d1890d5
Compare
|
@lovepoem @zonghaishang |
Please provide the full jar package that has this exception:
thanks. |
|
@zonghaishang 但是用 #1232 提交之前的代码,是工作很好的。既然AbstracthessianInput增加了方法,为什么heassian2能兼容和heassian1就不支持?这本身会导致所有的hessian1协议在#1232之后不再得到支持。 当然我也可以如你所说,去掉hessian1的junit以保证测试用例ok。 HessianInput.inistant()方法本意是构造一个对象而已。但是类创建者不知道会传入一个null。 “Please provide the full jar package that has this exception:
|
|
既然AbstracthessianInput增加了方法,为什么heassian2能兼容和heassian1就不支持?
|
|
既然AbstracthessianInput增加了方法,为什么heassian2能兼容和heassian1就不支持?
|
9cf2384 to
cf00db5
Compare
Example: org.springframework.jdbc.UncategorizedSQLException org.springframework.beans.MethodInvocationException com.alibaba.com.caucho.hessian.io.HessianProtocolException: 'com.alibaba.com.caucho.hessian.io.beans.ConstructNPE' could not be instantiated at com.alibaba.com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:313) Caused by: java.lang.reflect.InvocationTargetException at com.alibaba.com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:309) Caused by: java.lang.NullPointerException at com.alibaba.com.caucho.hessian.io.beans.ConstructNPE.<init>(ConstructNPE.java:15)
|
Hi, please check the CI failure. |
|
@takeseem After discussing with @zonghaishang For this question, you can implement custom Deserializer, and then register it to SerializerFactory, such as: Deserializer des = new XXXDeserializer();
ExtSerializerFactory ext = new ExtSerializerFactory();
ext.addDeserializer(UncategorizedSQLException.class, des);
serializerFactory.addFactory(ext);You can try it with this way. |
|
@takeseem, hessian-lite is moved out into github/dubbo, pls. feel free to resubmit PR there, if you don't agree with @diecui1202's suggestion. |
this is an old issue #210
I think if use
constructor(null...)throwNPEthen try use constructor(new Arg1(), new Arg2()) again to instance a bean, is a good idea.JavaDeserializer NPF for org.springframework.jdbc.UncategorizedSQLException