Skip to content

dubbo-consumer模块HelloController类报NPE #1

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

Closed
Qibie opened this issue Nov 28, 2018 · 5 comments
Closed

dubbo-consumer模块HelloController类报NPE #1

Qibie opened this issue Nov 28, 2018 · 5 comments

Comments

@Qibie
Copy link

Qibie commented Nov 28, 2018

跟着教程撸了一遍,进浏览器报了NPE,然后跟了一下,自己改了一下。
原代码:

public class HelloController {
    @Reference
    private HelloService helloService;

修改后:

public class HelloController {
    @Reference
    private HelloService helloService = new HelloServiceImpl();
@Snailclimb
Copy link
Collaborator

赞一个!

@wlmvp
Copy link

wlmvp commented Jan 30, 2019

这个好像不能这么做吧

@JXWJS
Copy link

JXWJS commented Jul 30, 2019

@wlmvp 可以,upcast

@Gabriel-18
Copy link

很无奈项目没有搭建成功....

@houzhenguo
Copy link

同样遇到了楼主的问题。参考了一下。不过这种解决方式可以么。直接就new出来了,而不是注入的方式。

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

6 participants