qq_41698573
qq_41698573
采纳率0%
2019-02-22 12:52 阅读 998

ssm+dubbo框架 自己的service端运行不报错 web运行也不报错 一旦访问就报错

20
package com.pinyougou.sellergoods.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.pinyougou.mapper.TbBrandMapper;
import com.pinyougou.pojo.TbBrand;
import com.pinyougou.sellergoods.service.BrandService;
@Service
public class BrandServiceImpl implements BrandService{

    @Autowired
    private TbBrandMapper brandMapper;

    public List<TbBrand> findAll() {
        List<TbBrand> list = brandMapper.selectByExample(null);
        return list;
    }

}

自己写了一个brandService运行是正常的 zookeeper ip也没错 就是获取不到服务 启动controller访问页面时报错

错误信息如下

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brandController' defined in file [F:\workspace\pinyougou-parent\pinyougou-manager-web\target\classes\com\pinyougou\manager\controller\BrandController.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanInitializationException: Failed to init remote service reference at filed brandservice in class com.pinyougou.manager.controller.BrandController; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.pinyougou.sellergoods.service.BrandService. No provider available for the service com.pinyougou.sellergoods.service.BrandService from the url zookeeper://192.168.25.132:2181/com.alibaba.dubbo.registry.RegistryService?application=com.pinyougou.manager.controller&dubbo=2.8.4&interface=com.pinyougou.sellergoods.service.BrandService&methods=findAll&pid=4104&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1550809827732 to the consumer 192.168.201.1 use dubbo version 2.8.4

应该是无法从注册中心找到该服务;可是我服务运行也没问题 地址也没写错

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • weixin_42920757 小小菜鸟2020 2019-02-22 14:14

    brandService 能访问吗?

    点赞 评论 复制链接分享
  • HJ007hj HJ007hj 2019-03-20 15:46

    我也遇到同样的问题,如果其他配置正确,关闭跑的项目再把这个项目instal.图片说明

    后来我又遇到这个问题,只修改2处,
    1:查看dubbo的端口号是否改变,如果改变修改zookeeper的端口
    2:修改版本号,和之前的不同图片说明图片说明

    点赞 评论 复制链接分享

相关推荐