Monday, April 30, 2012

Re: RequestFactory and Value Proxy for Objectify Key problem

For anyone else that passes this way looking for the cause of the AssertionError: Incorrect size: 2 in AutoBeanCodexImpl$CoderCreator.getCoder()...

I had an AutoBean with an ArrayList<AnotherAutoBean>.  I changed it to be just List<AnotherAutoBean> and it fixed the problem.

Cheers,
Pete

On Friday, July 8, 2011 9:58:24 AM UTC+10, Phil C wrote:
I am trying to convert our application to use RequestFactory (GWT 2.3
using all com.google.web.bindery.requestfactory.shared references).  I
am running into issues when trying to use an entity proxy for the
objectify key class.

@ProxyFor(Key.class)
public interface KeyProxy<T extends EntityProxy> extends ValueProxy{
        long getId();
        String getKindClassName();
        String getName();
        KeyProxy<?> getParent();
        <V extends EntityProxy> KeyProxy<V> getRoot();
}

the entity class then has a reference to the key like this

public interface BarProxy{
  Key<BarProxy> getKey();
}

we end up with an error like

java.lang.AssertionError: Incorrect size: 2
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl
$CoderCreator.getCoder(AutoBeanCodexImpl.java:124)
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl
$PropertyCoderCreator.maybeCreateCoder(AutoBeanCodexImpl.java:354)
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl
$PropertyCoderCreator.visitReferenceProperty(AutoBeanCodexImpl.java:
341)
    at

when looking at it in the deubugger, there appear to be 2 coders.  The
first is for BarProxy, and the second is for the Key.

Any help appreciated.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Q-tnuKALCgwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment