GWT RequestFactory - Using a new setter on a proxy object causes IllegalArgumentException

StackOverflow https://stackoverflow.com/questions/21285312

質問

I have a request factory proxy object and the "old" setter methods I can use without a problem. Now I added a new field and a setter for that field (on the backend object). I also defined the method in my proxy object.

But if I call the setter for the new field on the frontend, I get an IllegalArgumentException. I use GWT + Maven. Do I need to clear some kind of cache or some old objects, so the compiler knows about the new field? I tried maven clean, eclipse clean but nochting helped.

My proxy interface looks like this:

@ProxyFor(value = User2.class, locator = EntityLocator.class)
public interface User2Proxy extends EntityProxy{

    void setPassword(String password);

}

The backend object looks like that:

public class User2 implements Serializable {

private String password;

public String getPassword() {
    return password;
}

public void setPassword(String password) {
    this.password = password;
}

}

And I create the proxy object like this:

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

user.setPassword("abc")

So the input can not be wrong with a string like "abc"

役に立ちましたか?

解決

I found the problem: I need in the proxy object not only the setter-method but also the getter. If that method is provided, it works!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top