Monday, October 20, 2014

GWT RequestFactory. Could not locate setter for property id in type ...ui.server.entity.mc.BasketItem at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator die(ServiceLayerDecorator.java 216)

Hi all, i decided to use GWT Request Factory instead of RPC because of complex type objects in my project. I face this error everytime when i try to remove entity from List. 

public class BasketItem implements Serializable{
    private Integer id;
    private PaymentState paymentState;

    public BasketItem() {
        super();
    }

    public BasketItem(PaymentState paymentState) {
        this.paymentState = paymentState;
    }
    public Integer getId() {
        return id;
    }

    void setId(Integer id) {
        this.id = id;
    }

    public PaymentState getPaymentState() {
        return paymentState;
    }

    public void setPaymentState(PaymentState paymentState) {
        this.paymentState = paymentState;
    }
}


@ProxyFor(value = BasketItem.class)
public interface BasketItemProxy extends ValueProxy {

    public Integer getId();

    public PaymentStateProxy getPaymentState();
}


@Service(value = BasketFacadeRemote.class, locator = BasketFacadeServiceLocator.class)
public interface BasketRequestContext extends RequestContext {
    Request<Integer> registerBasketPayment(PaymentStateProxy payment);
    Request<Boolean> editBasketPayment(BasketItemProxy item);
    Request<Boolean> confirmBasketPayment();
    Request<Boolean> confirmBasketPayment(BasketItemProxy item);
    Request<Boolean> cancelBasketPayment(BasketItemProxy item);
    Request<Boolean> cancelBasketPayment(List<BasketItemProxy> items);
    Request<List<BasketItemProxy>> getBasketListItems();
    Request<BasketProxy> getBasket();
}


public interface BasketFacadeRemote {
    Integer registerBasketPayment(PaymentState payment);
    Boolean editBasketPayment(BasketItem item);
    Boolean confirmBasketPayment();
    Boolean confirmBasketPayment(BasketItem item);
    Boolean cancelBasketPayment(BasketItem item);
    Boolean cancelBasketPayment(List<BasketItem> items);
    List<BasketItem> getBasketListItems();
    Basket getBasket();
}


Here is a snippet of code where I try to call cancelBasketPayment method, and here I cath this error :


 final BasketRequestContext basketRequestContext = EntityService.get().getBasketRequestContext();
                      ArrayList<BasketItemProxy> removeList = new ArrayList<BasketItemProxy>();
                      for (BasketItemProxy bi : PaymentsBasketLayout.getDgSelectionModel().getSelectedSet()) {
                          removeList.add(RequestFactoryUtil.cloneProxy(BasketItemProxy.class, bi, basketRequestContext));
                      }
                      basketRequestContext.cancelBasketPayment(removeList).fire(new CustomReceiver<Boolean>() {
                          @Override
                          public void onSuccess(Boolean response) {
                             // PROCESS
                                      
                                  }
            
Please help...

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment