报错日记:
Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getUserAuthLevel, provider: dubbo://10.80.1.117:21553/com..ifp.oum.uia.api.IOumUserInfo?anyhost=true&application=bp&check=false&default.timeout=500000&dubbo=2.4.5&interface=com..ifp.oum.uia.api.IOumUserInfo&logger=slf4j&methods=checkPhoneIsExist,getUserInfo,getUserAuthLevel,getUserRegisterChannel&owner=&pid=729&revision=2.0.0&side=consumer×tamp=1508745323817, cause: java.lang.UnsupportedOperationException: com.alibaba.com.caucho.hessian.io.BasicDeserializer@158acad4 java.lang.UnsupportedOperationException: com.alibaba.com.caucho.hessian.io.BasicDeserializer@158acad4 at com.alibaba.com.caucho.hessian.io.AbstractDeserializer.readObject(AbstractDeserializer.java:103) at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2067) at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1592) at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1576) at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:94) at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:99) at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:83) at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:109) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:97) at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:128)
原因是引入注解的时候变量名称和dobbo的consumer配置中的ID名称不一致。
解决办法:
consumer.xml中的配置内容:
<dubbo:reference id="userService" interface="com.api.service.IUserService"/>
类文件中注解引入的代码为:
@Resource private IUserService userService;//userService和配置中的ID要一致