调用的接口与实际的接口参数个数、类型不一样
com.caucho.hessian.client.HessianRuntimeException: com.caucho.hessian.io.HessianProtocolException: expected end of map ('z') at '?'
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java)
at $Proxy4.checkLogin(Unknown Source)
at com.msd.test.marketing.MarketingHession.testLogin(MarketingHession.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.caucho.hessian.io.HessianProtocolException: expected end of map ('z') at '?'
at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1642)
at com.caucho.hessian.io.HessianInput.readMapEnd(HessianInput.java:1220)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:190)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:127)
at com.caucho.hessian.io.AbstractMapDeserializer.readObject(AbstractMapDeserializer.java:81)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java)
at com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:285)
... 25 more
hessain接口方法不能重载(方法名一样参数不一样)会报找不到方法
hessain方法重载解决的办法:
HessianProxyFactory factory = new HessianProxyFactory();
factory.setOverloadEnabled(true);
另外一种异情况:
Caused by: com.caucho.hessian.io.HessianProtocolException: expected integer at 0x63
at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2705)
at com.caucho.hessian.io.Hessian2Input.expect(Hessian2Input.java:2686)
at com.caucho.hessian.io.Hessian2Input.readInt(Hessian2Input.java:845)
at com.caucho.hessian.io.Hessian2Input.readObjectDefinition(Hessian2Input.java:2024)
at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1674)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:220)
... 2 more
com.caucho.hessian.io.HessianProtocolException: expected integer at 0x63
请检查接口编写端与调用端Hessian版本是否一致