RequestFactory and Value Proxy for Objectify Key problem

380 views
Skip to first unread message

Phil C

unread,
Jul 7, 2011, 7:58:24 PM7/7/11
to Google Web Toolkit
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.

Kevin Jordan

unread,
Jul 10, 2011, 10:51:42 PM7/10/11
to Google Web Toolkit
Well, that should be KeyProxy, not Key there. I'm also not sure if
you're going to be able to do the T extends EntityProxy generics since
I'm trying to convert my application to RequestFactory too and seem to
be having problems doing that.

Kevin Jordan

unread,
Jul 10, 2011, 11:28:50 PM7/10/11
to Google Web Toolkit
Also, what's the point of the generics on your KeyProxy as T isn't
used to return or set anything in the class.

On Jul 7, 6:58 pm, Phil C <philipcrave...@gmail.com> wrote:

Phil C

unread,
Jul 11, 2011, 10:17:41 AM7/11/11
to google-we...@googlegroups.com
Look into Appengine Objectify project to answer that question.

Peter Leong

unread,
Apr 30, 2012, 8:10:46 PM4/30/12
to google-we...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages