开发者社区 > 云原生 > 正文

consumer启动时报如下错误:

spring boot 2.6.6 nacos 2.0.4 dubbo 3.0.7

provider启动正常 consumer启动时报如下错误:

2022-04-03 16:27:28.360 INFO 33240 --- [ main] o.a.d.c.cache.FileCacheStoreFactory : [DUBBO] Failed to create file store cache. Local file cache will be disabled. Cache file name: C:\Users\liguo.dubbo.metadata.nacos127.0.0.1%003a8848.dubbo.cache, dubbo version: 3.0.7, current host: 192.168.137.1

org.apache.dubbo.common.cache.FileCacheStoreFactory$PathNotExclusiveException: C:\Users\liguo.dubbo.metadata.nacos127.0.0.1%003a8848.dubbo.cache is not exclusive. at org.apache.dubbo.common.cache.FileCacheStoreFactory.tryFileLock(FileCacheStoreFactory.java:149) [dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.common.cache.FileCacheStoreFactory.getFile(FileCacheStoreFactory.java:115) [dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.common.cache.FileCacheStoreFactory.lambda$getInstance$0(FileCacheStoreFactory.java:82) [dubbo-3.0.7.jar:3.0.7] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_311] at org.apache.dubbo.common.cache.FileCacheStoreFactory.getInstance(FileCacheStoreFactory.java:82) [dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.metadata.AbstractCacheManager.init(AbstractCacheManager.java:47) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.metadata.store.MetaCacheManager.(MetaCacheManager.java:59) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.AbstractServiceDiscovery.(AbstractServiceDiscovery.java:85) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.AbstractServiceDiscovery.(AbstractServiceDiscovery.java:66) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.nacos.NacosServiceDiscovery.(NacosServiceDiscovery.java:59) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.nacos.NacosServiceDiscoveryFactory.createDiscovery(NacosServiceDiscoveryFactory.java:27) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory.lambda$getServiceDiscovery$0(AbstractServiceDiscoveryFactory.java:53) ~[dubbo-3.0.7.jar:3.0.7] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_311] at org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory.getServiceDiscovery(AbstractServiceDiscoveryFactory.java:53) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.getServiceDiscovery(ServiceDiscoveryRegistry.java:122) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.createServiceDiscovery(ServiceDiscoveryRegistry.java:109) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.(ServiceDiscoveryRegistry.java:86) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryFactory.createRegistry(ServiceDiscoveryRegistryFactory.java:35) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:89) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.RegistryFactoryWrapper.getRegistry(RegistryFactoryWrapper.java:33) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:393) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getServiceDiscoveryInvoker(InterfaceCompatibleRegistryProtocol.java:63) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshServiceDiscoveryInvoker(MigrationInvoker.java:428) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:244) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:73) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:57) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:243) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:535) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:505) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:487) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:83) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:74) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.ReferenceConfig.createInvokerForRemote(ReferenceConfig.java:494) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:397) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:285) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:219) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:110) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:387) ~[dubbo-3.0.7.jar:3.0.7] at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707) ~[na:1.8.0_311] at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:367) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:154) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:111) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:100) ~[dubbo-3.0.7.jar:3.0.7] at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:45) ~[dubbo-3.0.7.jar:3.0.7] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.6.jar:2.6.6] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.6.jar:2.6.6] at org.liguo.dubbo.consumer.ConsumerApplication.main(ConsumerApplication.java:13) ~[classes/:na]

dubbo 3.0.5 没有这样的问题!

原提问者GitHub用户xtuul

展开
收起
大圣东游 2023-05-11 19:07:56 235 0
1 条回答
写回答
取消 提交回答
  • 通过查看源码做如下配置,修改他的缓存存储目录 dubbo.mapping.cache.filePath

    下面这段是源码 public MappingCacheManager(String name, ScheduledExecutorService executorService) { String filePath = System.getProperty("dubbo.mapping.cache.filePath"); String fileName = System.getProperty("dubbo.mapping.cache.fileName"); if (StringUtils.isEmpty(fileName)) { fileName = DEFAULT_FILE_NAME; }

    if (StringUtils.isNotEmpty(name)) {
        fileName = fileName + "." + name;
    }
    
    String rawEntrySize = System.getProperty("dubbo.mapping.cache.entrySize");
    int entrySize = StringUtils.parseInteger(rawEntrySize);
    entrySize = (entrySize == 0 ? DEFAULT_ENTRY_SIZE : entrySize);
    
    String rawMaxFileSize = System.getProperty("dubbo.mapping.cache.maxFileSize");
    long maxFileSize = StringUtils.parseLong(rawMaxFileSize);
    
    init(filePath, fileName, entrySize,  maxFileSize, 50, executorService);
    

    }

    原回答者GitHub用户chiangho

    2023-05-12 10:56:31
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载