Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8642153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:42:20+00:00 2026-06-12T11:42:20+00:00

I am using Objectify to manage GAE Datastore for my GWT app. The problem

  • 0

I am using Objectify to manage GAE Datastore for my GWT app. The problem is that I am not using queries properly and I get UmbrellaExceptions as per below:

Caused by: java.lang.RuntimeException: Server Error: java.lang.String cannot be cast to java.lang.Number
    at com.google.web.bindery.requestfactory.shared.Receiver.onFailure(Receiver.java:44)

Say that I have a class Box with a unique field String id. I want to get the Box object whose id == "cHVQP6zZiUjM"

This is how I do it now:

public Box getBox(String boxId)
{
    Objectify ofy = ObjectifyService.begin();
    Query<Box> q=ofy.query(Box.class).filter("id",boxId);
    Box targetBox = q.get();

    return targetBox;
}


@Entity
public class Box extends DatastoreObject{
    private String id;
    private String title;
}

I tried doing this with ofy.load() but that method is not defined in my class Objectify (I don’t know why).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:42:21+00:00Added an answer on June 12, 2026 at 11:42 am

    The short answer: You are missing the @Id annotation in your entity.

    The long answer: Id fields are special in the datastore. The id is not a real property, but rather a part of the Key that identifies the entity. You can’t really filter on id fields, but you can filter on a special field called __key__. Objectify is somewhat clever about letting you filter by the id field and converting this to a __key__ filter under the covers, but it can’t do it if you don’t annotate the entity properly!

    Actually I’m a little confused because Objectify shouldn’t let you register the entity without an @Id field.

    By the way, there are two sections of the documentation: Objectify4 (release coming soon) and Objectify3. Since you’re using Ofy3, there is no load() method.

    Another thing: Get-by-key operations are strongly preferred to queries when the operations are equivalent (as they are in your example).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Google App Engine and Objectify 3.1 and slowly learning about denormalization and
I am doing a website about places to visit using java, gwt, gae, gwt-platform
I'm building a app that need manage money datatype. I'm new on Obj-c, so
I was using Objectify 3 and spring before. Now i am trying to shift
I am using objectify on appengine with the java runtime. I am also using
I am using objectify 3.1 on appengine and attempting to do a ancestor query.
I am using Objective-C in my app and I have a question about multiple
I am trying to do a little timer app in Objective-C/Cocoa. I am using
I have created a class that I've been using as the storage for all
For C++ code I can manage memory on my own by using placement new/delete

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.