RequestFactory exception when creating a proxy

450 views
Skip to first unread message

Sydney

unread,
Jun 3, 2011, 5:47:07 PM6/3/11
to google-we...@googlegroups.com
An exception is thrown when I try to create a proxy:

myRequestProvider.get().create(MyDomainDomain.class);

java.lang.IllegalArgumentException: Unknown proxy type com.app.shared.proxy.MyDomainProxy
    at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.createProxy(AbstractRequestContext.java:411)
    at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.create(AbstractRequestContext.java:401)

with MyDomainProxy

@ProxyFor(MyDomain.class)
public interface MyDomainProxy extends EntityProxy {

    String getProperty();

    void setProperty(String property);

}


and MyDomain class

// DatastoreObject handles a Long id and a version
public class MyDomain extends DatastoreObject {

    private String property;

    public MyDomain() {
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

}

Thanks

Thomas Broyer

unread,
Jun 3, 2011, 5:54:41 PM6/3/11
to google-we...@googlegroups.com
Every proxy has to be referenced as an argument or return type in one of the RequestContext methods for a given RequestFactory, otheriwse it cannot be created, because the RequestFactory does not "know" about it.

Y2i

unread,
Jul 25, 2011, 1:30:13 AM7/25/11
to google-we...@googlegroups.com
I started getting the same error after upgrading to 2.3.  The error occurs when a client receives response and attempts to create a proxy from the data encoded in the response string.  The stack up to the point of failure is at the bottom of the message.

When a response from the server is received, this method in JsniCreaterMap is called twice with the same proxy type (clazz).  First time the get() method succeeds, the second time it returns a null JsArray assigned to arr local variable.


The get() method is a simple java script lookup:


Not sure what's going on here, but it all worked fine before upgrading to GWT 2.3.

Once create() returns null, AbstractRequestFactory$2(AbstractRequestContext).createProxy(Class<T>, SimpleProxyId<T>) fails:


It looks like I'm not alone with this error and it started to occur in GWT 2.3.  Any help would be greatly appreciated.
Thanks!


6afUkn4PPdS7L*m[] (Suspended)
JsniCreatorMap$.create$(Class<T>, AbstractAutoBeanFactory) line: 50
AppRequestFactoryImpl_FactoryImpl(AbstractAutoBeanFactory).create(Class<T>) line: 44
AbstractRequestFactory$2(AbstractRequestContext).createProxy(Class<T>, SimpleProxyId<T>) line: 426
AbstractRequestFactory$2(AbstractRequestContext).getProxyForReturnPayloadGraph(SimpleProxyId<Q>) line: 673
AbstractRequestFactory$2(AbstractRequestContext).processReturnOperation(SimpleProxyId<Q>, OperationMessage, WriteOperation...) line: 757
AbstractRequestFactory$2(AbstractRequestContext).processReturnOperations(ResponseMessage) line: 1067
AbstractRequestContext.access$5(AbstractRequestContext, ResponseMessage) line: 1037
AbstractRequestContext$StandardPayloadDialect.processPayload(Receiver<Void>, String) line: 276
AbstractRequestContext$4.onTransportSuccess(String) line: 959
DefaultRequestTransport$1.onResponseReceived(Request, Response) line: 141
Request.fireOnResponseReceived(RequestCallback) line: 287
RequestBuilder$1.onReadyStateChange(XMLHttpRequest) line: 395
GeneratedMethodAccessor67.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
MethodAdaptor.invoke(Object, Object...) line: 103
MethodDispatch.invoke(JsValue, JsValue[], JsValue) line: 71
OophmSessionHandler.invoke(BrowserChannelServer, BrowserChannel$Value, int, BrowserChannel$Value[]) line: 167
BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer$SessionHandlerServer) line: 326
BrowserChannelServer.invokeJavascript(CompilingClassLoader, JsValueOOPHM, String, JsValueOOPHM[], JsValueOOPHM) line: 207
ModuleSpaceOOPHM.doInvoke(String, Object, Class<?>[], Object[]) line: 132
ModuleSpaceOOPHM(ModuleSpace).invokeNative(String, Object, Class<?>[], Object[]) line: 561
ModuleSpaceOOPHM(ModuleSpace).invokeNativeObject(String, Object, Class<?>[], Object[]) line: 269
JavaScriptHost.invokeNativeObject(String, Object, Class<?>[], Object[]) line: 91
Impl.apply(Object, Object, Object) line: not available
Impl.entry0(Object, Object, Object) line: 214
GeneratedMethodAccessor59.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
MethodAdaptor.invoke(Object, Object...) line: 103
MethodDispatch.invoke(JsValue, JsValue[], JsValue) line: 71
OophmSessionHandler.invoke(BrowserChannelServer, BrowserChannel$Value, int, BrowserChannel$Value[]) line: 167
BrowserChannelServer.reactToMessages(BrowserChannelServer$SessionHandlerServer) line: 281
BrowserChannelServer.processConnection() line: 531
BrowserChannelServer.run() line: 352
Thread.run() line: 662

Reply all
Reply to author
Forward
0 new messages