dubbo常见错误

1、dubbo zookeeper注册中心provider的ip地址为内网ip,导致consumer连不上

我用的阿里云的服务器,host默认配置了内网ip,注销或删除即可

vim /etc/hosts

2、linux提示内存不够

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000785a00000

解决办法

dubbo的启动脚本,可以设置jvm参数,修改 -Xms和-Xmx为1g,问题解决

3、 com.alibaba.dubbo.remoting.RemotingException: Fail to decode request due to: RpcInvocation [methodName=getById, parameterTypes=[], arguments=null, attachments={dubbo=2.8.4, input=245, path=com.mobjia.content.facade.ContentBasicDubboService, version=0.0.0}]

参数使用了long,改成了Long,参数须继承java.io.Serializable

4、Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan timer. start time: 2017-03-28 09:36:38.285, end time: 2017-03-28 09:36:44.295, client elapsed: 497 ms, server elapsed: 5513 ms, timeout: 6000 ms, request: Request [id=0, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=getById, parameterTypes=[class java.lang.Long], arguments=[153], attachments={path=com.mobjia.content.facade.ContentBasicDubboService, interface=com.mobjia.content.facade.ContentBasicDubboService, timeout=6000, version=0.0.0}]]

超时了,调整超时时间。

<dubbo:provider delay="-1" timeout="60000" retries="0"/>

5、com.alibaba.dubbo.rpc.RpcException: Forbid consumer 192.168.201.105 access service com.mobjia.set.facade.SetTestFacade from registry 127.0.0.1:2181 use dubbo version 2.8.4, Please check registry access list (whitelist/blacklist)

没有provider会导致该异常

6、Failed to check the status of the service com.mobjia.set.facade.SetBasicRestService. No provider available for the service com.mobjia.set.facade.SetBasicRestService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=mobjia-web&dubbo=2.8.4&interface=com.mobjia.set.facade.SetBasicRestService&methods=getSetBasic,getString,getSetBasicList&organization=mobjia&owner=lyp&pid=9328&revision=1.0&side=consumer&timestamp=1491446741230&validation=false to the consumer 192.168.201.105 use dubbo version 2.8.4

参见:https://dangdangdotcom.github.io/dubbox/rest.html

在一般应用中,我们建议将annotation放到服务实现类,这样annotation和java实现代码位置更接近,更便于开发和维护。另外更重要的是,我们一般倾向于避免对接口的污染,保持接口的纯净性和广泛适用性。

但是,如后文所述,如果我们要用dubbo直接开发的消费端来访问此服务,则annotation必须放到接口上。

如果接口和实现类都同时添加了annotation,则实现类的annotation配置会生效,接口上的annotation被直接忽略。

需要把注释放到接口上。

7、java.lang.ClassNotFoundException: org.jboss.resteasy.client.jaxrs.ClientHttpEngine

没有resteasy jar包

8、 Line 9 in XML document from class path resource [META-INF/dubbo/dubbo-consumer.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 77; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 'dubbo:application' 的声明。

网上有说没有导入dubbo jar包。

我用eclipse clean以后可以了

9、 无法读取方案文档 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd', 原因为 1) 无法找到文档; 2) 无法读取文档; 3) 文档的根元素不是 <xsd:schema>。

同8

10、java.Lang.OutOfMemoryError  内存不足

调整linux线程数默认配置

vim  /etc/security/limit.d

计算用户可用的线程数:

ulimit -u

cat /proc/meminfo |grep MemTotal

线程数=MemTotal/128

 

posted @ 2017-03-16 16:38  青羽  阅读(3256)  评论(0编辑  收藏  举报