dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

use dubbo in spring boot junit test cannot get service

Open meixinbin opened this issue 7 years ago • 4 comments

Environment

  • Dubbo version: 2.6.5
  • Operating System version: mac os
  • Java version: 1.8

Steps to reproduce this issue

  1. use dubbo in spring boot 2.0.4 junit test cannot get service

Expected Result

通过@Reference 注解注入服务调用方法

Actual Result

无法注入相应的服务,获取的bean是null

Method threw 'java.lang.NullPointerException' exception. Cannot evaluate com.sun.proxy.$Proxy158.toString()
<img width="923" alt="default" src="https://user-images.githubusercontent.com/16658917/51436694-edcc3500-1ccc-11e9-89cb-2c44ba26c679.png">

<img width="925" alt="default" src="https://user-images.githubusercontent.com/16658917/51436676-af367a80-1ccc-11e9-921a-62e08dc5b2b5.png">

meixinbin avatar Jan 20 '19 08:01 meixinbin

Please DO NOT evaluate DEBUG object in IDEA with toString() review

mercyblitz avatar Jan 22 '19 06:01 mercyblitz

Plz pull up a demo project to git. PS: Your img can't preview.

Bricks-Man avatar Jan 25 '19 03:01 Bricks-Man

not a bug.

beiwei30 avatar Feb 02 '19 03:02 beiwei30

这确实是一个bug,同样的代码,我用dubbo2.5版本是没有问题的

default default

meixinbin avatar Feb 02 '19 05:02 meixinbin