java.lang.IllegalArgumentException: Unknown proxy type

693 views
Skip to first unread message

Y2i

unread,
Aug 3, 2011, 4:14:45 AM8/3/11
to google-we...@googlegroups.com
Just tried to migrate from 2.2 to 2.4 RC1.

First, the project didn't compile because of internal compiler errors.  All obsolete RF-related stuff is removed from 2.4 (good), but if the project uses RF there is no way to move to 2.4 without migrating from gwt to web.bindery.
After migrating from gwt to web.bindery the internal compiler error disappeared (good).
After fixing some incompatibilities the project now compiles and the application starts (good).
But it fails to run in exactly the same spot as when moving from 2.2 to 2.3 without migration from gwt to web.bindery (bad).  And in 2.2 the application runs fine.

Here is the culprit:

interface P extends EntityProxy { ... }
interface PA extends P { ... }
interface PB extends P { ... }

interface R extends RequestContext {
  Request<Long> queryCountOfP(P p);
}

When queryCountOfP() accepts an instance of PA, the onSuccess() callback is called fine.
When queryCountOfP() accepts an instance of PB, the failure occurs:

java.lang.IllegalArgumentException: Unknown proxy type PB

The server receives the call, the argument type of the service method is correct (B), but after returning to the client the following method throws an exception:
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.createProxy(AbstractRequestContext.java:489)
Neither onSuccess() nor onFailure() nor onViolation() gets called.

Why does the method fails on PB but not on PA?  Is there anything wrong with this usage pattern?

Thanks!

Y2i

unread,
Aug 4, 2011, 10:53:13 PM8/4/11
to google-we...@googlegroups.com
bumping up...

Y2i

unread,
Aug 16, 2011, 3:44:08 PM8/16/11
to google-we...@googlegroups.com

Andigator

unread,
Aug 17, 2011, 3:34:35 PM8/17/11
to Google Web Toolkit
This happens for me when I am extending EntityProxy directly for
proxyA and proxyB and try to append requestA to requestB. @ExtraTypes
won't fix it in my case. Ideas?

Y2i

unread,
Aug 17, 2011, 5:30:58 PM8/17/11
to google-we...@googlegroups.com
Have you tried to use @ExtraTypes on an interface that extends RequestFactory?

PTed

unread,
Aug 18, 2011, 11:43:52 AM8/18/11
to google-we...@googlegroups.com
@ExtraTypes works. But I have multiple request calls. So @ExtraTypes can't be used. Also the Proxies don't extends. 
Reply all
Reply to author
Forward
0 new messages