Why do I keep getting a java.lang.NullPointerException General error in Base?

I have created over and over a very simple database to catalogue some artefacts for a conservation report. I use a simple form for data entry and everything seems to work for 4 or 5 entries until suddenly I get this message:

Κατάσταση SQL: S1000
Κωδικός σφάλματος: 40
S1000 General error java.lang.NullPointerException in statement [INSERT INTO “Πίνακας_Εγγραφές” ( “Κτήριο”,“Συνοικία”,“Τοίχος”,“Φωτό1”,“Χώρος”) VALUES ( ?,?,?,?,?)]

or this:

Κατάσταση SQL: S1000
Κωδικός σφάλματος: 98
java.io.IOException: java.lang.NullPointerException in statement [INSERT INTO “Πίνακας_Εγγραφή” ( “Κτήριο”,“Συνοικία”,“Τοίχος”,“Υλικά_Κατασκευής”,“Φωτό1”,“Χώρος”) VALUES ( ?,?,?,?,?,?)]

Form won’t save and all the data is lost or tables don’t open at all and I get this message:

Κατάσταση SQL: S1000
Κωδικός σφάλματος: 40
S1000 General error java.lang.NullPointerException in statement [SELECT * FROM “Πίνακας_Εγγραφές”]

At first I thought it might have something to do with interconnected tables and form with subform design but I get the same errors even with the simplest single table DB.
Is Base temperamental or am I doing something terribly wrong?

Libreoffice 5.2.1.2 (x64)
Windows 10
Java RE 1.8.0_102 installed and activated.

Did you assign a primary key for the table “Πίνακας_Εγγραφές”?

Yes, I did assign a primary key.

It appears you are trying to save images in an embedded database. If so, you should either change to a split database or save links to the images instead of the a blob. Please see this post (click here) for further information.

Thank you for your answer. I’m going to give the split database a go although it’s a bit complicated for a noob like myself. Not being able to change field properties after I save a table and having to use sql I find a bit daunting. If I go for the links to images scenario will I be able to copy the finished db and distribute it? Will I need to relink to new paths?

Either approach you take will require more than one file for distribution. In the case of split database it is a folder with about a half dozen files and a couple of sub-folders. With the linked files, the linked images must go with and if set up correctly within a folder with the .odb may not need to be re-linked. I believe the split DB should always be used instead of the embedded DB regardless of whether saving images, links or any important data.

I used the split database template you suggested and rebuilt my db linking my image files with a text field. I also used a connected image control to make image entry simpler. Everything is working great so far so thank you for your help. Have placed all image files inside an image folder which is in the same folder as frontend and backend db files. Judging from the path I see in the image text field, I’m guessing my final db will be distributable. Any other suggestions for proper folder setup?

First of all, I’m glad all is working now. One thing to keep in mind, when saving, save the entire folder where the Split DB resides. All parts are necessary. However, now you are less likely to have any lost data problems which can (and does) occur with the embedded database. SQL is just another piece you need sooner or later anyway. Lots of on-line sites to assist there.

If this answers your question please click on the :heavy_check_mark: (upper left area of answer).