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×tamp=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