1. 程式人生 > >PHP呼叫Java的hessian介面報錯:Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at -1

PHP呼叫Java的hessian介面報錯:Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at -1

出錯提示:

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Hessian skeleton invocation failed; nested exception is java.io.IOException: Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at -1] with root cause
INFO   | jvm 1    | 2018/08/09 20:12:06 | java.io.IOException: Expected 'H'/'C' (Hessian 2.0) or 'c' (Hessian 1.0) in hessian input at -1

原因:PHP所用的hessian包版本,和Java所用hessian版本不匹配。PHP所用hessian包不同於Java,都是1.0,2.0這種形式,版本號並不對應。

個人情況是:

Java-4.0.38

PHP-2.0.3