1

I'm trying to replicate the java guestbook example on Quercus on AppEngine and I'm getting an error having to do with preparing the query:

$greetings = $datastore->prepare($query)->asIterable();

I'm not a java developer so I can't make sense of the error trace. How can I get the greeting items without triggering this error?

Here is the entire error page:

HTTP ERROR 500

Problem accessing /index.php. Reason:

INTERNAL_SERVER_ERROR

Caused by:

java.lang.NullPointerException at com.google.appengine.api.datastore.dev.LocalDatastoreService.next(LocalDatastoreService.java:1089) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:498) at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:452) at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:430) at java.util.concurrent.Executors$PrivilegedCallable$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.util.concurrent.Executors$PrivilegedCallable.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

nnnnnn
  • 147,572
  • 30
  • 200
  • 241
userBG
  • 6,860
  • 10
  • 31
  • 39
  • If this is a Java question why is your page "index.php"? – nnnnnn Apr 22 '14 at 22:29
  • Because Quercus is a java based PHP environment. By the way, I gave up on this a long time ago and learned Python. I haven't touched PHP since. – userBG Apr 23 '14 at 21:57

1 Answers1

0

If it's a null pointer exception then you are trying to access a method or property of a null object
First you need to check if $datastore is null, then if the return of the query is not null. Also you need to check if that error is on that particular line of code (maybe it fails somewhere else)
You can access the database at this link /_ah/admin. Maybe there is a corrupt entity in there

Bogdan.Nourescu
  • 905
  • 6
  • 17