Problem with simple... ok not so simple :) application

DeerBear

Member
Licensed User
Longtime User
Hello!

I am enthused in the wonders of SQLite... hating it every minute more!
This is my log, please bear with me, it's the first time I post one and I am
pretty sure that it's going to be a disaster :) LOL
Anyway, from what I could find, it seems there is a problem starting my service.

This service does quite a bit of nifty things, in theory it should start and wait there for the activities to call it.

I suspect it could be a problem of "StartServiceAt"
missing, but I am not sure that is definitely the case.
I haven't used it because I do not want to wake it up at predefined times,
I want to have it active in the background at all times :)

I will be able to provide a zip if necessary.

LogCat connected to: emulator-5554
** Activity (main) Create, isFirst = true **


** Activity (main) Resume **


** Service (booksservice) Create **
Query : SELECT _id FROM BOOK_ENTRIES
Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1
Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (java line: 116)

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:116)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:285)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:309)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:471)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:116)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:285)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:309)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:471)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more
** Service (booksservice) Create **
Query : SELECT _id FROM BOOK_ENTRIES
Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1
Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (java line: 116)

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:116)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:285)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:309)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:471)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)


at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:116)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:285)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:309)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:471)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (booksservice) Create **
Query : SELECT _id FROM BOOK_ENTRIES
Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1
Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (B4A line: 32)
ResBookEntry.Zones.Initialize2( Zones )

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)


at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (booksservice) Create **
Query : SELECT _id FROM BOOK_ENTRIES
Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1
Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (B4A line: 32)
ResBookEntry.Zones.Initialize2( Zones )

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)


at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (booksservice) Create **
Query : SELECT _id FROM BOOK_ENTRIES
Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1
Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (B4A line: 32)
ResBookEntry.Zones.Initialize2( Zones )

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (booksservice) Create **
Query : SELECT _id FROM BOOK_ENTRIES
Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1
Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (B4A line: 32)
ResBookEntry.Zones.Initialize2( Zones )

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)


at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more
** Service (booksservice) Create **


Query : SELECT _id FROM BOOK_ENTRIES


Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1


Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (B4A line: 32)


ResBookEntry.Zones.Initialize2( Zones )

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException


at android.app.ActivityThread.handleCreateService(ActivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice.java:38)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstypes.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(booksservice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservice.java:477)
at ar.b4a.tutorial.booksservice._service_create(booksservice.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more(<< this ain't me, it's what says in the log window)

Regards,

A
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Usually it is enough to post only the error message:
** Service (booksservice) Create **


Query : SELECT _id FROM BOOK_ENTRIES


Query : SELECT * FROM BOOK_ENTRIES WHERE _id = 1


Query : SELECT * FROM ZONE_BOOKS WHERE BOOK_ID = 1
bookstypes_loadbookentry (B4A line: 32)


ResBookEntry.Zones.Initialize2( Zones )

java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstyp es.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(bookss ervice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservi ce.java:477)
at ar.b4a.tutorial.booksservice._service_create(books service.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice .java:38)
at android.app.ActivityThread.handleCreateService(Act ivityThread.java:2959)
at android.app.ActivityThread.access$3300(ActivityThr ead.java:125)
at android.app.ActivityThread$H.handleMessage(Activit yThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99 )
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.jav a:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Unable to create service ar.b4a.tutorial.booksservice: java.lang.RuntimeException: java.lang.NullPointerException


at android.app.ActivityThread.handleCreateService(Act ivityThread.java:2969)
at android.app.ActivityThread.access$3300(ActivityThr ead.java:125)
at android.app.ActivityThread$H.handleMessage(Activit yThread.java:2087)
at android.os.Handler.dispatchMessage(Handler.java:99 )
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.jav a:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:199)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at ar.b4a.tutorial.booksservice.onCreate(booksservice .java:38)
at android.app.ActivityThread.handleCreateService(Act ivityThread.java:2959)
... 10 more
Caused by: java.lang.NullPointerException
at ar.b4a.tutorial.bookstypes._loadbookentry(bookstyp es.java:150)
at ar.b4a.tutorial.booksservice._loadbookentry(bookss ervice.java:434)
at ar.b4a.tutorial.booksservice._loadbooks(booksservi ce.java:477)
at ar.b4a.tutorial.booksservice._service_create(books service.java:751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
... 13 more(<< this ain't me, it's what says in the log window)
The problem is in this line: ResBookEntry.Zones.Initialize2( Zones )

I'm not familiar with this example. I guess that ResBookEntry was not initialized.
 
Upvote 0
Top