node-hessian icon indicating copy to clipboard operation
node-hessian copied to clipboard

'hessian-proxy' throw exception:Out of Original Buffer's Boundary

Open cfuns opened this issue 10 years ago • 1 comments

when I use hessian-proxy get useInfo Entity,all data can normal return data but 'xiaoyan.li-1',begin I think maybe hessian-proxy version is low,but when i grow version from 0.0.4 to 0.0.5, the result is same like before. while I found the test data 'yue.zhang-2' like 'xiaoyuan.li-1' ,It's will really work better and return normal data. Now I think maybe hessian protocal control in hessian-proxy possible have bug. what My check code like this below:

var name = process.argv[2];
var file = process.argv[3];
var Proxy = require('hessian-proxy').Proxy;

var fs = require('fs');

name ='xiaoyan.li-1';//yue.zhang-2

fs.readFile(file,function(err,contents){
   var lines = contents.toString().split("\n").length - 1;
   console.log(lines+"===="+name);
   var url = "http://host:port/employee-hessian/hessian/UserFacade";

   var proxy = new Proxy(url);
   console.log("queryUserByLoginName : " + url);

   proxy.invoke("queryUserByLoginName", [name], function (err, reply) {
      if (err) {
        console.log(err);
      }
      console.log("source ====="+ reply);
      console.log("00000000999==="+JSON.stringify(reply));
      //callback(err, reply);
   });
});

the exception like this:

{ [AssertionError: Out of Original Buffer's Boundary] name: 'AssertionError', actual: false, expected: true, operator: '==', message: 'Out of Original Buffer's Boundary' }

cfuns avatar Jun 21 '15 00:06 cfuns

This happens if the server returns an empty response due to an internal error. I got the same error with a method that existed twice with the same name and arguments in the Java service on the server. In hessian-proxy, only method name and number of arguments are transmitted in order to identify the corresponding service method. If two matching methods exist, the server may choose the wrong one and hit an error while parsing the arguments. In the end, the server sends an empty response and hessian-proxy chokes while trying to parse the response. I am sure there are other reasons why the server cannot parse the request or otherwise hits an error during request processing which finally leads to the error reported.

dirichs avatar Jul 17 '18 11:07 dirichs