web项目启动时dubbo报错: No provider available for the service com.davidhu.shopguide.api.service.UserEventService from the url zookeeper ://localhost:2181/org.apache.du

发布时间 2024-01-13 02:46:58作者: zjhgx
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.davidhu.shopguide.api.service.UserEventService. No provider available for the service com.davidhu.shopguide.api.service.UserEventService from the url zookeeper     ://localhost:2181/org.apache.dubbo.registry.RegistryService?application=com-hu-shopguide-consumer&dubbo=2.0.2&init=false&interface=com.davidhu.shopguide.api.service.UserEventService&metadata-type=remote&methods=saveUserEvent,removeById,lambdaQuery,r     emoveByMap,save,getObj,update,saveYunpanSearchLog,saveOrUpdateBatch,remove,listByIds,getBaseMapper,removeByIds,updateBatchById,lambdaUpdate,saveOrUpdate,listMaps,saveBatch,query,listObjs,count,list,getMap,updateById,pageMaps,listByMap,getById,getOne     ,page&pid=4130&qos.enable=false&reference.filter=traceUser&register.ip=192.168.1.103&release=2.7.8&retries=0&side=consumer&sticky=false&timeout=300000&timestamp=1705082694911 to the consumer 192.168.1.103 use dubbo version 2.7.8

一开始以为是网络问题,但把代理关掉,重启电脑也没法解决。后来看到zookeeper在admin项目启动时有个警告:

2024-01-13 02:12:06,266 [myid:] - WARN  [NIOWorkerThread-11:NIOServerCnxn@364] - Unexpected exception
966 EndOfStreamException: Unable to read additional data from client, it probably closed the socket: address = /127.0.0.1:55084, session = 0x0

以为是zookeeper问题,用zookeeper自带的client zkClient 连上去,发现 ls /dubbo/ervice com.davidhu.shopguide.api.service.UserEventService/provider 确实是个空,而其他的Service都有值。最终发现mvn clean install解决问题。真是一个坑啊。下次再分析下代理引起的dubbo问题。