Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: DB4O Problems
    primarykey
    data
    text
    <p>I'm trying to populate a listviewactivity's list with objects returned from an DB40 database, but my app keeps crashing and I'm not entirely sure why.</p> <p>It would help if I knew how to read LogCat and be able to go from what it says -.- I can get a rough understanding I just don't know what exactly is going wrong.</p> <pre><code>public class AndrochieveActivity extends ListActivity { private List&lt;Achievement&gt; achieves; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ObjectContainer db = Db4oEmbedded.openFile("achievements.db4o"); try{ achieves = db.query(Achievement.class); } finally { db.close(); } setListAdapter(new ArrayAdapter&lt;Achievement&gt;(this, R.layout.achievelist, achieves) { @Override public View getView(int pos, View cView, ViewGroup parent) { View row = mInflater.inflate(R.layout.achievelist, null); TextView title = (TextView) row.findViewById(R.id.title); title.setText(getItem(pos).GetTitle()); TextView desc = (TextView)row.findViewById(R.id.desc); desc.setText(getItem(pos).GetDescription()); TextProgressBar prog = (TextProgressBar)row.findViewById(R.id.prog); prog.setProgress(0); prog.setMax(getItem(pos).GetMax()); return row; } }); } </code></pre> <p>I'm not seeing anything that would inherently screw it up. Db4oEmbedded.openFile should create the file if it doesn't exit, but I keep getting a bunch of file read errors in logcat, from what it looks like:</p> <pre><code>11-29 14:21:44.359: D/AndroidRuntime(19396): Shutting down VM 11-29 14:21:44.359: W/dalvikvm(19396): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0) 11-29 14:21:44.389: E/AndroidRuntime(19396): FATAL EXCEPTION: main 11-29 14:21:44.389: E/AndroidRuntime(19396): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.megalon.androchieve/com.megalon.androchieve.AndrochieveActivity}: com.db4o.ext.Db4oIOException: /achievements.db4o (Read-only file system) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1849) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1870) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.ActivityThread.access$1500(ActivityThread.java:132) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1051) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.os.Handler.dispatchMessage(Handler.java:99) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.os.Looper.loop(Looper.java:150) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.ActivityThread.main(ActivityThread.java:4312) 11-29 14:21:44.389: E/AndroidRuntime(19396): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 14:21:44.389: E/AndroidRuntime(19396): at java.lang.reflect.Method.invoke(Method.java:507) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607) 11-29 14:21:44.389: E/AndroidRuntime(19396): at dalvik.system.NativeStart.main(Native Method) 11-29 14:21:44.389: E/AndroidRuntime(19396): Caused by: com.db4o.ext.Db4oIOException: /achievements.db4o (Read-only file system) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.io.RandomAccessFileFactory.newRandomAccessFile(RandomAccessFileFactory.java:26) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.io.FileStorage$FileBin.&lt;init&gt;(FileStorage.java:43) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.io.FileStorage.open(FileStorage.java:22) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.io.StorageDecorator.open(StorageDecorator.java:27) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.io.CachingStorage.open(CachingStorage.java:52) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.internal.IoAdaptedObjectContainer.openImpl(IoAdaptedObjectContainer.java:57) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.internal.ObjectContainerBase$1.run(ObjectContainerBase.java:140) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.foundation.DynamicVariable.with(DynamicVariable.java:54) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.foundation.Environments.runWith(Environments.java:28) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.internal.ObjectContainerBase.withEnvironment(ObjectContainerBase.java:161) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.internal.ObjectContainerBase.open(ObjectContainerBase.java:131) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.internal.IoAdaptedObjectContainer.&lt;init&gt;(IoAdaptedObjectContainer.java:35) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.internal.ObjectContainerFactory.openObjectContainer(ObjectContainerFactory.java:18) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.Db4oEmbedded.openFile(Db4oEmbedded.java:65) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.Db4oEmbedded.openFile(Db4oEmbedded.java:76) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.megalon.androchieve.AndrochieveActivity.onCreate(AndrochieveActivity.java:45) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072) 11-29 14:21:44.389: E/AndroidRuntime(19396): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1813) 11-29 14:21:44.389: E/AndroidRuntime(19396): ... 11 more 11-29 14:21:44.389: E/AndroidRuntime(19396): Caused by: java.io.FileNotFoundException: /achievements.db4o (Read-only file system) 11-29 14:21:44.389: E/AndroidRuntime(19396): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method) 11-29 14:21:44.389: E/AndroidRuntime(19396): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232) 11-29 14:21:44.389: E/AndroidRuntime(19396): at java.io.RandomAccessFile.&lt;init&gt;(RandomAccessFile.java:132) 11-29 14:21:44.389: E/AndroidRuntime(19396): at java.io.RandomAccessFile.&lt;init&gt;(RandomAccessFile.java:173) 11-29 14:21:44.389: E/AndroidRuntime(19396): at com.db4o.io.RandomAccessFileFactory.newRandomAccessFile(RandomAccessFileFactory.java:19) 11-29 14:21:44.389: E/AndroidRuntime(19396): ... 28 more 11-29 14:21:44.419: D/dalvikvm(19396): GC_CONCURRENT freed 308K, 49% free 2900K/5639K, external 0K/0K, paused 2ms+3ms 11-29 14:21:46.310: D/Process(19396): killProcess, pid=19396 11-29 14:21:46.310: D/Process(19396): dalvik.system.VMStack.getThreadStackTrace(Native Method) 11-29 14:21:46.320: D/Process(19396): java.lang.Thread.getStackTrace(Thread.java:745) 11-29 14:21:46.320: D/Process(19396): android.os.Process.killProcess(Process.java:797) 11-29 14:21:46.320: D/Process(19396): com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:108) 11-29 14:21:46.320: D/Process(19396): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:854) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload