dongyuanlongwang opened a new issue #232: while I use @Autowired In 
CommandLineRunner To inject  dubb proxy .  spring cloud not found the 
beanDefinition
URL: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/232
 
 
   `DemoService`  is a dubbo proxy 。
   
   expected: inject and worked fine
   
   actually:  Field demoService in XXX.ConsumerCommandLineRunner required a 
bean of type 'XXX.api.DemoService' that could not be found.
   
   
   code is here
   
   ```java
   @Component
   @Slf4j
   public class ConsumerCommandLineRunner implements CommandLineRunner {
   
       @Autowired
       private DemoService demoService;
   
       @Override
       public void run(String... args) throws Exception {
           log.info(demoService.sayHello("world"));
   
           log.info("☺");
       }
   }
   
   ```
   
   only use this  it  cloud work 
   ```java
       @Reference
       private DemoService demoService;
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to