微服务相关

203 阅读1分钟
  1. 入门:blog.csdn.net/Axela30W/ar…(和spring 中的@Autowired注解类似,不过在duboo中是注入远程服务)。如果先启动服务者会报如下错误:
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'ServiceBean:mistraServiceImpl:com.mistra.dubbo.api.MistraService:${mistra.service.version}' defined in null
@RestController
public class ConsumerController {

    @Reference(version = "${mistra.service.version}")
    private MistraService mistraService;

    @RequestMapping("/sayHello/{name}")
    public String sayHello(@PathVariable("name") String name) {
        return mistraService.welcome(name);
    }
}
  1. zookeeper启动Error: JAVA_HOME is incorrectly set问题解决,在zookeeper目录bin下的zkEnv.cmd中 新增
set JAVA_HOME="C:\Program Files (x86)\Java\jdk1.8.0_121"