Dubbo java.io.IOException: Can not lock the registry cache file

跑单测用例的时候,以前执行成功的用例,运行时控制台仍然会报 dubbo 相关的错误:

Failed to save registry store file, cause: Can not lock the registry cache file

2016-03-22 17:16:05,493 [DubboSaveRegistryCache-thread-1] WARN  com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry -  [DUBBO] Failed to save registry store file, cause: Can not lock the registry cache file /Users/baidu/.dubbo/dubbo-registry-1*.9*.3*.3*.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties, dubbo version: 2.5.3, current host: 1*.9*.3*.3*.

java.io.IOException: Can not lock the registry cache file /Users/baidu/.dubbo/dubbo-registry-1*.9*.3*.3*.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties

at com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:193) ~[dubbo-2.5.3.jar:2.5.3]

at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:150) [dubbo-2.5.3.jar:2.5.3]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79]

at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]

Dubbo在保存服务列表时失败,Can not lock the registry cache file /Users/baidu/.dubbo/dubbo-registry-1*.9*.3*.3*.cache,拿不到文件锁,无法保存服务列表。

Dubbo通过注册中心发现服务,发现的服务Dubbo同时也会保存到本地缓存一份,缓存的好处有很多,比如不需要每次使用的时候都通过注册中心获取,注册中心不可用了,不影响消费端的调用,因为本地缓存了一份服务提供者列表。Dubbo本地缓存默认采用的文件,会根据注册中心自动在当前用户目录下生成一个缓存文件,类似/home/newad/.dubbo/dubbo-registry-*.*.*.*.cache,星号表示注册中心的IP地址,当同一台机器上同时启动多个进程,就会出现多个进程争夺此文件的写入权限,觖此问题的方法也很简单,日志里面都说了重新配置一下这个缓存文件就可以了。

我的解决办法是进入到目录:/Users/baidu/.dubbo/ 下,把文件重新命名一下,或者删除,就可以了。

时间: 2024-10-11 07:13:11

Dubbo java.io.IOException: Can not lock the registry cache file的相关文章

java java.io.IOException: No locks available异常处理解决

try {    randomAccessFile = new RandomAccessFile(file, "rw");    lock = randomAccessFile.getChannel().tryLock();} catch (IOException e) {    e.printStackTrace();}出现如下异常:Caused by: java.io.IOException: No locks available    at sun.nio.ch.FileChan

Hive报错 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D

报错信息如下 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D 解决方法: 编辑 hive-site.xml 文件,添加下边的属性 <property> <name>system:java.io.tmpdir<

java.io.IOException: No space left on device 错误

今天碰到比较奇怪的问题: 7/05/14 19:20:24 INFO util.Utils: Fetching http://192.168.31.160:33039/jars/spark_study_java-0.0.1-SNAPSHOT-jar-with-dependencies.jar to /tmp/spark-446068a4-aaa4-4277-b009-908bf0d4ecac/executor-dcc3175b-7d19-4485-81e1-bf31a83a66b4/spark-

java.io.IOException: Attempted read from closed stream

代码如下,执行的时候提示“java.io.IOException: Attempted read from closed stream.” @Test public void test_temp(){ String url="http://ssov1.59iedu.com/login?TARGET=http://med.ihbedu.com:80/gateway/web/sso/auth&js&callback=loginThen&1470491151264&no

spark程序异常:Exception in thread &quot;main&quot; java.io.IOException: No FileSystem for scheme: hdfs

命令: java -jar myspark-1.0-SNAPSHOT.jar myspark-1.0-SNAPSHOT.jar hdfs://single:9000/input/word.txt hdfs://single:9000/output/out1 错误信息: .......... 14/11/23 06:14:18 INFO SparkDeploySchedulerBackend: Granted executor ID app-20141123061418-0011/0 on hos

android studio java.io.IOException:setDataSourse fail.

这一次是针对Android开发中的一个小问题,权限获取的问题. 在写了一个一个小Android程序的时候,有时候普需要获取本机的文件(Audio&Video),这时候如果不加权限就会出现这种情况: java.io.IOException:setDataSourse failed. 此时应该在 注册一下权限: 这样,问题解决.

hadoop错误Could not obtain block blk_XXX_YYY from any node:java.io.IOException:No live nodes contain current block

错误: 10/12/08 20:10:31 INFO hdfs.DFSClient: Could not obtain block blk_XXXXXXXXXXXXXXXXXXXXXX_YYYYYYYY from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry 原因: Datanode 有一个同时处理文件

hbase异常:java.io.IOException: Unable to determine ZooKeeper ensemble

项目中用到hbase,有时候可能会报一些异常,比如java.io.IOException: Unable to determine ZooKeeper ensemble 等等,当出现这个问题时,某某说是项目中用到线程池的问题导致的,但查看异常之后,并非跟啥线程池有关系,异常信息如下: java.io.IOException: Unable to determine ZooKeeper ensemble at org.apache.hadoop.hbase.zookeeper.ZKUtil.con

Android 蓝牙 java.io.IOException: Connection refused 异常处理笔记

最近在做一个手机和Pad连接音箱的应用,需要用到蓝牙连接发送命令来控制音箱,但是在RfcommSocket连接时, 在pad上会出现一个 java.io.IOException: Connection refused 的异常,纠结好久一直没有解决,连接代码如下: http://www.ehotelier.cn/Thread.jsp?tid=481784 http://www.ehotelier.cn/Thread.jsp?tid=481784 http://www.ehotelier.cn/Th