Sunday, June 22, 2014

GWT RequestFactory: IllegalArgumentException for setter only fields

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