每当我尝试使用XADisk将 byte[] 保存到文件时,我都会收到 XASystemNoMoreAvailableException:
org.xdisk.filesystem.exceptions.XASystemNoMoreAvailableException:XADisk 实例遇到严重问题,不再可用。这种情况非常罕见。如果您认为您已经为 XADisk 工作设置了正确的设置,请考虑在 XADisk 论坛中讨论,或提出带有详细信息的错误
根据示例,我的代码是最基本的......
public static void main(String[] args) throws Exception
{
StandaloneFileSystemConfiguration configuration = new StandaloneFileSystemConfiguration("xadiskFolder", "1");
XAFileSystem XAF = XAFileSystemProxy.bootNativeXAFileSystem(configuration);
XAF.waitForBootup(-1);
Session session = XAF.createSessionForLocalTransaction();
byte[] myByteArray = getByteArrayFromSomewhere();
File myFile = new File("outputFile.test");
session.createFile(myFile, false);
XAFileOutputStream output = session.createXAFileOutputStream(myFile, true);
output.write(myByteArray);
output.close();
session.commit();
}