Menu

#2 Null Pointers using OpenBaseMovil-db

openbasemovil-db
open
Development (5)
5
2008-01-25
2008-01-24
No

I've made this a support request rather than a bug because it seems I'm likely doing something obvious wrong.

I want to use OpenBaseMovil-db as I have a need to store and then find around 5,000 items. I wrote a simple test that created a database, added a table and inserted one row into it but I was getting NullPointerExceptions. So I whittled the code down to the simplest thing possible - just creating a database.

I have tried this on the Nokia Series 40 3rd Edition Emulator and Nokia Series 60 3rd Edition Emulator with the same results.

Any pointers appreciated

private void createDB() {
try {
System.out.println("About to create database");
Database.create( VIRTUAL_DATABASE_NAME );
}
catch(Exception e) {
e.printStackTrace();
}
}

Here is the output:
[exec] About to create database
[exec] at bm.storage.Store.close(+116)
[exec] at bm.db.Database.close(+7)
[exec] at bm.db.Database.saveHeader(+163)
[exec] at bm.db.Database.create(+70)
[exec] at com.shearwell.test.mobile.ui.PerformanceTestUI.createDB(+13)
[exec] at com.shearwell.test.mobile.ui.PerformanceTestUI.commandAction(+203)
[exec] at com.shearwell.test.mobile.ui.UIManager.commandAction(+188)
[exec] at javax.microedition.lcdui.Display.consumeDisplayEvent(+773)
[exec] at javax.microedition.lcdui.Display$DisplayAccessor.consumeEvent(+109)
[exec] at com.nokia.mid.impl.isa.ui.EventDispatcher.run(+41)
[exec] bm.storage.RSException: java.lang.NullPointerException

Discussion

  • Tim Corrigan

    Tim Corrigan - 2008-01-24

    Logged In: YES
    user_id=1988524
    Originator: YES

    Oh - I'm using version 3.0, donwloaded 23/01/08

     
  • Narciso Cerezo

    Narciso Cerezo - 2008-01-25
    • labels: 1041811 --> Development
    • assigned_to: nobody --> narciso_cerezo
     
  • Narciso Cerezo

    Narciso Cerezo - 2008-01-25

    Logged In: YES
    user_id=1895782
    Originator: NO

    Hi Tim,
    This is very strange, the code is really simple.
    We've tested it using the emulator (Sun WTK), but also we've run it on some S60 phones (E70, E90) and I know that it has run fine to that point also in S40 3rd edition devices (Nokia 6233).
    Though, we've not tried the emulators from Nokia.
    We will try the code with those two and see what it happens, a NPE in the Store.close method seems strange.
    Thanks for your information, we'll update as soon as we try it.
    Have you tried the sample code in a real phone?

    By the way,
    There's a small update does not affect you if you are just working with the database, under the release 3.0 but with version 3.0.01 fixing a bug that prevented the build tools (resource-packer and view-compiler) to run on Windows platforms.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.