赞
踩
springboot 微服务在同一台机器上运行多个dubbo项目,报错如下:Failed to create file store cache. Local file cache will be disabled. Cache file name
解决办法是在SpringBoot启动类中加入如下代码,修改dubbo的缓存文件为jar包所在的位置:
@EnableDubbo
@SpringBootApplication
public class DataApplication {
public static void main(String[] args) {
ApplicationHome home = new ApplicationHome(DataApplication.class);
File jarFile = home.getSource();
String dirPath = jarFile.getParentFile().toString();
String filePath = dirPath + File.separator + ".dubbo";
System.out.println(filePath);
System.setProperty("dubbo.meta.cache.filePath", filePath);
System.setProperty("dubbo.mapping.cache.filePath",filePath);
SpringApplication.run(DataApplication.class, args);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。