On Sat, Dec 13, 2014 at 6:09 AM, <[email protected]> wrote:
>
> Thank you for answering. I tried to create another project, and I now
> consider a Dog entity, but the problem is exactly the same as before. My
> goal is still to query my entities filtering the name.
>
> Uncaught exception from servlet
>> java.io.IOException:
>> com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException:
>> Object Manager has been closed (through reference chain:
>> java.util.HashMap["items"])
>>
>>
The issue seems to be that the persistence manager is shut down before the
Dog entities in the List get fully loaded.
I would suggest adding a *for* loop iterating through the *List<Dog>* just
after the *q.execute* line - this forces the loading of each list entry. To
test that the list holds data, also try printing out a property from each
instance of Dog (you can remove the line after verifying the code works).
So for instance, a sample loop could look like:
//this goes right after q.execute
for (int i = 0; i < candidates.size(); i++) {
Dog candidate = candidates.get(i)
System.out.println(candidate.getSomeStringProperty());
}
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL
App Engine Code Samples: http://www.learntogoogleit.com
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.