springboot集成dubbo服務報錯No provider available for the service

檢查了下發現是由於沒有正確編寫暴露服務的註解,須要注意下:spa

@Service(interfaceClass = StudentService.class,timeout = 15000) @Component public class StudentServiceImpl implements StudentService {
@Service(interfaceClass = StudentService.class,timeout = 15000)這個註解必定要寫,並且要使用com.alibaba.dubbo.config.annotation;的不能寫錯
interfaceClass = StudentService.class這個是具體的服務接口
timeout = 15000這個是服務超時時間

@Component這個註解負責把服務對象放入容器。
相關文章
相關標籤/搜索