2

我正在尝试为我正在编写的应用程序配置数据库。我已经启动了 OrientDB 服务器并创建了一个数据库,以及一个用户名和密码。我希望能够将我的应用程序与此联系起来,但我目前正处于测试阶段。

这是测试:` static OObjectDatabaseTx db; 静态people.group组;

public static void main(String[] args) 
{ 
    try {

        db = new OObjectDatabaseTx("local:/Users/<me>/Documents/Java/OrientDB/Sources/releases/orientdb-1.3.0-SNAPSHOT/databases/people");
        System.out.println("db made");
        db.open("nick", "nick");
        System.out.println("db open");



        group = new people.Group();
        System.out.println("group made");

        db.save(group);

        System.out.println("group saved");
        System.out.println(group);


    } catch (Exception e) {

        System.out.println("Not succeed - " + e.getMessage());
        e.printStackTrace();
    } finally {

        if( db != null ) {
            db.close();
        }

    }

}`

运行时,输出:

在 com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) 在 com.orienttechnologies.orient.object.db.OObjectDatabaseTx.open(OObjectDatabaseTx.java:99) 上打开(ODatabaseWrapperAbstract.java:47)在 db.ToFromByte.main(ToFromByte.java:34) 引起:com.orientechnologies.orient.core.exception.OSerializationException:无法加载数据库的配置。数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多 orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) 在 com.orienttechnologies.orient.object.db.OObjectDatabaseTx.open(OObjectDatabaseTx.java:99) 在 db.ToFromByte.main(ToFromByte.java: 34) 原因:com.orientechnologies.orient.core.exception.OSerializationException:无法加载数据库的配置。数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多 orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:47) 在 com.orienttechnologies.orient.object.db.OObjectDatabaseTx.open(OObjectDatabaseTx.java:99) 在 db.ToFromByte.main(ToFromByte.java: 34) 原因:com.orientechnologies.orient.core.exception.OSerializationException:无法加载数据库的配置。数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多 orientechnologies.orient.object.db.OObjectDatabaseTx.open(OObjectDatabaseTx.java:99) at db.ToFromByte.main(ToFromByte.java:34) 原因:com.orientechnologies.orient.core.exception.OSerializationException:无法加载数据库的配置. 数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多 orientechnologies.orient.object.db.OObjectDatabaseTx.open(OObjectDatabaseTx.java:99) at db.ToFromByte.main(ToFromByte.java:34) 原因:com.orientechnologies.orient.core.exception.OSerializationException:无法加载数据库的配置. 数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多 OSerializationException:无法加载数据库的配置。数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多 OSerializationException:无法加载数据库的配置。数据库似乎已损坏。在 com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:73) 在 com.orienttechnologies.orient.core.storage.impl.local.OStorageLocal.addDefaultClusters(OStorageLocal.java:215)在 com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:143) ... 7 更多

所以代码在这行代码上失败了: db.open("nick", "nick"); 这里会发生什么?该数据库似乎可以通过 OrientDB 服务器访问。

4

1 回答 1

0

可能数据库现在已损坏,因为服务器和本地同时运行?

于 2012-12-02T19:43:09.600 回答