1

当使用带有备份目录的 Microstream 数据库时,除了“PersistenceTypeDictionary.ptd”之外的所有文件都被克隆到备份目录中。

尝试将备份目录用作原始数据库时,Microstream 尝试重现此丢失的文件,但出现 NullPointerException:

Exception in thread "main" java.lang.RuntimeException: Problem in channel 0
    at one.microstream.storage.types.StorageChannelTask$Abstract.checkForProblems(StorageChannelTask.java:61)
    at one.microstream.storage.types.StorageChannelTask$Abstract.waitOnCompletion(StorageChannelTask.java:123)
    at one.microstream.storage.types.StorageManager$Default.startThreads(StorageManager.java:280)
    at one.microstream.storage.types.StorageManager$Default.internalStartUp(StorageManager.java:449)
    at one.microstream.storage.types.StorageManager$Default.start(StorageManager.java:519)
    at one.microstream.storage.types.StorageManager$Default.start(StorageManager.java:1)
    at one.microstream.storage.types.EmbeddedStorageManager$Default.start(EmbeddedStorageManager.java:233)
    at one.microstream.storage.types.EmbeddedStorageManager$Default.start(EmbeddedStorageManager.java:1)
    at one.microstream.storage.types.EmbeddedStorage.createAndStartStorageManager(EmbeddedStorage.java:580)
    at one.microstream.storage.types.EmbeddedStorage.start(EmbeddedStorage.java:464)
    at com.packenius.book.microstream.examples.backup.Backup_03_CountBackupListEntries.main(Backup_03_CountBackupListEntries.java:12)
Caused by: java.lang.NullPointerException
    at one.microstream.storage.types.StorageFileManager$Default.clearRegisteredFiles(StorageFileManager.java:299)
    at one.microstream.storage.types.StorageFileManager$Default.clearState(StorageFileManager.java:1186)
    at one.microstream.storage.types.StorageFileManager$Default.initializeStorage(StorageFileManager.java:871)
    at one.microstream.storage.types.StorageChannel$Default.initializeStorage(StorageChannel.java:621)
    at one.microstream.storage.types.StorageChannelTaskInitialize$Default.succeed(StorageChannelTaskInitialize.java:197)
    at one.microstream.storage.types.StorageChannelTaskInitialize$Default.succeed(StorageChannelTaskInitialize.java:1)
    at one.microstream.storage.types.StorageChannelSynchronizingTask$AbstractCompletingTask.synchronizedComplete(StorageChannelSynchronizingTask.java:61)
    at one.microstream.storage.types.StorageChannelSynchronizingTask$AbstractCompletingTask.complete(StorageChannelSynchronizingTask.java:109)
    at one.microstream.storage.types.StorageChannelTask$Abstract.processBy(StorageChannelTask.java:213)
    at one.microstream.storage.types.StorageChannel$Default.work(StorageChannel.java:281)
    at one.microstream.storage.types.StorageChannel$Default.run(StorageChannel.java:351)
    at java.lang.Thread.run(Thread.java:748)

我的行为有什么问题?

4

1 回答 1

1

异常表示类型字典不完整。如果没有正确的类型字典,就无法加载现有存储。在您的案例中创建的只是一个最小的默认类型字典。

不幸的是,我不能说为什么 PersistenceTypeDictionary.ptd 没有写入备份目录。

于 2020-01-13T07:01:46.177 回答