英文:
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("jetbrains.exodus.io.WatchingFileDataReaderWriterProvider").
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.<init>(MBeanBase.java:36)
答案1
得分: 1
我会将您提供的内容翻译如下:
我会将这视为一个错误。为了解决问题,可以关闭管理功能:EnvironmentConfig.setManagementEnabled(false)
。
英文:
I'd consider this as a bug. To work around, turn management off: EnvironmentConfig.setManagementEnabled(false)
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论