Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo-client启动报错 #93

Open
yanghui8837 opened this issue Nov 29, 2019 · 0 comments
Open

dubbo-client启动报错 #93

yanghui8837 opened this issue Nov 29, 2019 · 0 comments

Comments

@yanghui8837
Copy link

Exception in thread "main" java.lang.NullPointerException
at org.spring.springboot.dubbo.CityDubboConsumerService.printCity(CityDubboConsumerService.java:20)
at org.spring.springboot.ClientApplication.main(ClientApplication.java:22)

为什么这个springboot项目 启动就会直接调用CityDubboConsumerService的方法

/**

  • 城市 Dubbo 服务消费者

  • Created by bysocket on 28/02/2017.
    */
    @component
    public class CityDubboConsumerService {

    @reference(version = "1.0.0")
    CityDubboService cityDubboService;

    public void printCity() {
    String cityName="温岭";
    City city = cityDubboService.findCityByName(cityName); // 这行启动就报空指针
    System.out.println(city.toString());
    }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant