0

下面是为 XMLManager 创建实例的代码,

    EnvironmentConfig config = new EnvironmentConfig();
    config.setErrorStream(System.err);
    config.setAllowCreate(true);
    config.setRunRecovery(true);
    config.setTransactional(true);
    config.setInitializeLocking(true);
    config.setInitializeLogging(true);
    config.setInitializeCache(true);
    config.setLogAutoRemove(true);
    config.setCacheSize(25 * 1024 * 1024); // 25MB cache
    dbEnv =  new Environment(<db-env-home>, config);

    XmlManagerConfig xmlMgrCfg = new XmlManagerConfig();
    xmlMgrCfg.setAdoptEnvironment(true); 

    XmlManager  _xmlMgr =  new XmlManager(dbEnv , xmlMgrCfg);

运行此代码时,出现以下异常,

com.sleepycat.db.DatabaseException: Permission denied: __db.001: Permission denied: Permission denied at com.sleepycat.db.internal.db_javaJNI.DbEnv_open(Native Method) at com.sleepycat.db.internal.DbEnv.open(DbEnv .java:317) 在 com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:3886) 在 com.sleepycat.db.Environment.(Environment.java:93)

4

1 回答 1

1

您是否能够确认运行应用程序的用户对<db-env-home>路径具有写入权限?

于 2017-08-04T21:08:23.863 回答