现在主要是说下spring boot在自己的application.properties 文件里配置dubbo内容,这种方式遇到的问题。 问题一:dubbo接口发布不成功。 application.properties 文件中配置的,dubbo扫描发布接口包是否正确,即:#这是你要发布到dubbo的接口所在包位置
spring.dubbo.scan=test.spring.dubboService
 
com.alibaba.dubbo.config.annotation.Service 的@Service 注解。@Service 注解,是否还存在事务注解@Transactional ,原因是alibaba的@Service 注解与事务的注解,不能共用,去掉事务注解即可。(详情请看下一个问题)。问题二:dubbo发布的接口不能再添加事务注解@Transactional。 解决方法有三个: 
 
@Service 注解,加到TestDubboServiceImpl 上,然后在该实现类中,再引入TestService 接口,然后进入到TestServiceImpl ,将事务注解添加到TestServiceImpl 类中即可,这样就解决了,@Service 和@Transactional 的分离。具体如下:import  com. alibaba. dubbo. config. annotation.  Service ; 
import  test. spring. dubboService.  TestDubboService ; 
import  test. spring. localService.  TestService ; @Service 
public  class  TestDubboServiceImpl  implements  TestDubboService  { @Autowired  TestService  testService; @Override public  String  getName ( String  name)  { return  testService. getName ( name) ; } 
} 
import  org. springframework. beans. factory. annotation.  Autowired ; 
import  org. springframework. stereotype.  Service ; 
import  test. spring. localService.  TestService ; 
@Service 
public  class  TestServiceImpl  implements  TestService { @Autowired TestMapper  testMapper; @Override @Transactional public  String  getName ( String  name)  { return  testMapper. selectByName ( name) ; ; } } 
@Service 注解。#这是你要调用的dubbo的接口所在包位置
spring.dubbo.scan=test.spring.dubboService
import  org. springframework. web. bind. annotation.  RestController ; 
import  com. alibaba. dubbo. config. annotation.  Reference ; @RestController 
public  class  TestController  { @Reference TestDubboService  testDubboService; @RequestMapping ( value= "abc/akf" , method= RequestMethod . GET) public  String  abc ( String  name) {   return  testDubboService. getName ( name) ; } 
}