问题描述
这是我在使用db4oobjectmanager打开.yap数据库时报的错<db4o stacktrace>java.lang.RuntimeException: File format incompatible. at com.db4o.inside.Exceptions4.throwRuntimeException(Unknown Source) at com.db4o.inside.Exceptions4.throwRuntimeException(Unknown Source) at com.db4o.YapFile.readThis(Unknown Source) at com.db4o.YapRandomAccessFile.open(Unknown Source) at com.db4o.YapRandomAccessFile.<init>(Unknown Source) at com.db4o.Sessions.open(Unknown Source) at com.db4o.Db4o.openFile(Unknown Source) at com.db4o.browser.model.Db4oFileConnectionSpec.connectInternal(Unknown Source) at com.db4o.browser.model.Db4oConnectionSpec.connect(Unknown Source) at com.db4o.browser.model.Db4oDatabase.reopen(Unknown Source) at com.db4o.browser.model.Db4oDatabase.open(Unknown Source) at com.db4o.browser.model.BrowserCore.getDatabase(Unknown Source) at com.db4o.browser.model.BrowserCore.iterator(Unknown Source) at com.db4o.browser.gui.controllers.BrowserTabController.internalSetInput(Unknown Source) at com.db4o.browser.gui.controllers.BrowserTabController.open(Unknown Source) at com.db4o.browser.gui.controllers.BrowserTabController.open(Unknown Source) at com.db4o.browser.gui.standalone.StandaloneBrowser$3.widgetSelected(Unknown Source) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3070) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2703) at com.db4o.browser.gui.standalone.SWTProgram.runWithLog(Unknown Source) at com.db4o.browser.gui.standalone.StandaloneBrowser.main(Unknown Source) </db4o stacktrace>Uncaught exception in SWT event loopjava.lang.IllegalArgumentException: Could not open: F:work_unionDB4oTestauto.yap at com.db4o.browser.model.Db4oDatabase.reopen(Unknown Source) at com.db4o.browser.model.Db4oDatabase.open(Unknown Source) at com.db4o.browser.model.BrowserCore.getDatabase(Unknown Source) at com.db4o.browser.model.BrowserCore.iterator(Unknown Source) at com.db4o.browser.gui.controllers.BrowserTabController.internalSetInput(Unknown Source) at com.db4o.browser.gui.controllers.BrowserTabController.open(Unknown Source) at com.db4o.browser.gui.controllers.BrowserTabController.open(Unknown Source) at com.db4o.browser.gui.standalone.StandaloneBrowser$3.widgetSelected(Unknown Source) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3070) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2703) at com.db4o.browser.gui.standalone.SWTProgram.runWithLog(Unknown Source) at com.db4o.browser.gui.standalone.StandaloneBrowser.main(Unknown Source)问题补充:我用了objectmanager-1.7.1-win_novm 和 objectmanager-6.1连个版本都不行啊 我能确认那个数据库文件是正确的 我用程序读出来了
解决方案
给你解释了,就是不行阿,目前没有支持最新版本的objectmanager明白了吗,或者等过一段时间就有了。
解决方案二:
我正在使用db4o开发web系统,有问题可以交流一下。qq:205135
解决方案三:
文件格式不对。可能你用了不同版本的db4o和objectmanager所以打不开。目前最新的db4o版本还没有objectmanager程序的升级支持。你可以使用6.x的db4o,objectmanager支持的比较好。如果为了新版本的性能,你可以写个简易的管理器。