无法打开只读环境。

huangapple go评论70阅读模式
英文:

Unable to open read-only Environment

问题

我正在尝试打开一个只读的环境,使用以下代码:

public Environment getReadOnlyEnvironment(String xodusRoot, String instance) {
    final EnvironmentConfig config = new EnvironmentConfig().
            setLogDataReaderWriterProvider("jetbrains.exodus.io.WatchingFileDataReaderWriterProvider").
            setLogCacheShared(false).
            setMemoryUsagePercentage(10);
    config.setLogLockTimeout(3000);
    Environment env = Environments.newInstance(xodusRoot + instance, config);
    return env;
}

问题是它一直抛出这个错误:

Caused by: javax.management.InstanceAlreadyExistsException: jetbrains.exodus.env: type=EnvironmentConfig, location=\var\xodus\master
    at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at jetbrains.exodus.management.MBeanBase.<init>(MBeanBase.java:36)
英文:

I'm trying to open a read-only Environment with:

  public Environment getReadOnlyEnvironment(String xodusRoot, String instance) {
    final EnvironmentConfig config = new EnvironmentConfig().
            setLogDataReaderWriterProvider(&quot;jetbrains.exodus.io.WatchingFileDataReaderWriterProvider&quot;).
            setLogCacheShared(false).
            setMemoryUsagePercentage(10);
    config.setLogLockTimeout(3000);
    Environment env = Environments.newInstance(xodusRoot + instance, config);
    return env;
  }

The problem is it keeps on throwing this error:

Caused by: javax.management.InstanceAlreadyExistsException: jetbrains.exodus.env: type=EnvironmentConfig, location=\var\xodus\master
	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
	at jetbrains.exodus.management.MBeanBase.&lt;init&gt;(MBeanBase.java:36)

答案1

得分: 1

我会将您提供的内容翻译如下:

我会将这视为一个错误。为了解决问题,可以关闭管理功能:EnvironmentConfig.setManagementEnabled(false)

英文:

I'd consider this as a bug. To work around, turn management off: EnvironmentConfig.setManagementEnabled(false).

huangapple
  • 本文由 发表于 2020年9月14日 14:32:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/63879155.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定