You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
public void printCity() {
String cityName="温岭";
City city = cityDubboService.findCityByName(cityName); // 这行启动就报空指针
System.out.println(city.toString());
}
}
The text was updated successfully, but these errors were encountered:
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());
}
}
The text was updated successfully, but these errors were encountered: