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 6644767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:12:20+00:00 2026-05-26T00:12:20+00:00

I am trying to use GWTs RequestFactory to (at the moment) do something very

  • 0

I am trying to use GWTs RequestFactory to (at the moment) do something very simple and return a list of objects each containing some data and another object. I don’t seem to be able to get my other object – instead I always get null.

My code looks something like this…

I have some UserMessage objects which each include a Message object.

UserMessage

@Entity
public class UserMessage implements Serializable {

  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue
  private Long id;

  @Version
  private Integer version = 0;

  @ManyToOne
  @JoinColumn(name = "messageId")
  private Message message;

  private String user;

  private int priority;

  private boolean read;

  private Date expiry;

  private boolean sent;

  ... getter/setters etc

Message

  @Entity(name = "UUMessage")
  public class Message implements Serializable {

  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue
  private Long id;

  @Version
  private Integer version = 0;

  private String title;

  private String mimeType;

  private String message;

  private Date received;

  private String fromUser;

  public Message() {

  }

  ... getter/setters etc

each with their own proxy classes

UserMessageProxy

@ProxyFor(value = UserMessage.class, locator = UserMessageLocator.class)
public interface UserMessageProxy extends EntityProxy {

  Long getId();

  void setId(Long id);

  MessageProxy getMessage();

  void setMessage(MessageProxy message);

  String getUser();
}

MessageProxy

@ProxyFor(value = Message.class, locator = MessageLocator.class)
public interface MessageProxy extends EntityProxy {

Long getId();

void setId(Long id);

String getTitle();

void setTitle(String title);

}

I have a factory and a context

@Service(value = CentralNotificationService.class, locator = CentralNotificationServiceLocator.class)
public interface CnsRequestContext extends RequestContext {

  Request<List<UserMessageProxy>> getMessagesForUser(String user, int start, int length);

}

When I call getMessagesForUser(…) on the client my server side service code gets called, the entries in the database are retrieved and I get a list of UserMessageProxy returned to the client. Unfortunately calling getMessage() on any of these returns null and I can’t work out why.

I am not getting any errors or warnings. On the server side I can “see” that the UserMessage does contain the Message objects when the RequestFactory code calls into my service classes.

Why are my objects null? Are there any conditions I am not satisfying?

GWT 2.4 BTW (but also had problems with 2.3)

  • 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-05-26T00:12:20+00:00Added an answer on May 26, 2026 at 12:12 am

    Your code is probably missing a .with("message"):

    When querying the server, RequestFactory does not automatically populate relations in the object graph. To do this, use the with() method on a request and specify the related property name as a String
    […]
    It is also necessary to use the with() method to retrieve any properties with types extending ValueProxy. The with() method takes multiple String arguments, so you can specify multiple property names at once. To specify nested properties, use dot notation.

    — Source: http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html#relationships

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

Sidebar

Related Questions

I am trying use javascript regular expressions to do some matching and I found
I'm trying use the Str[fixnum] to return a specific portion of a string. #
I'm trying use preg_match in an IF statement and return false if a string
I am trying use Thread but i have some problem (I am beginner at
Trying to use WMI to obtain a list of installed programs for Windows XP.
I'm trying to use the GWT CellTree to display a heterogeneous, hierarchical data model.
I'm trying use epoch time dates in my series data. The array looks like
I am trying use the django ORM to get a list by year of
Hi I'm trying use a mixin to define some method using define_method. I would
I have been trying use zenity with standard re-direction in a shell script, something

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.