Sunday, June 22, 2014

Re: GWT RequestFactory: IllegalArgumentException for setter only fields


I don't get why having a getter "defeats the purpose". Just because you have a getter does not mean there's a value to get.
You could also have a setPassword "service method" instead (you can probably use your existing User#setPassword using an InstanceRequest<UserProxy,Void> setPassword(String password) method)

On Monday, June 23, 2014 12:05:34 AM UTC+2, Arpit wrote:
Why is it mandatory to have both getters and setters for a field in RF Proxy interfaces? For some fields (like plain text password), you want setters only.

    @ProxyFor(value = User.class)
public interface UserProxy extends ValueProxy {
void setPassword(String password);

User class has both getters and setters.

public class User implements Serializable {
private String password;
public String getPassword() {
return password;
public void setPassword(String password) {
this.password = password;

When I set the password on proxy, I get an IllegalArgumentException:

    UserProxy user = userRequest.create(UserProxy.class);

Above code results in following error:
java.lang.IllegalArgumentException: password

This error goes away if I add a 'getPassword()' method in UserProxy interface but that defeats the purpose. Any help is appreciated. 


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment