In pretty basic RF scenario, I'm fetching one EntityProxy from server:

myRequestContext.search(url).with("path1", "path2").to(...).fire()

MyRequestContext.java:

@Service(ModelService.class)
public interface MyRequestContext extends RequestContext {

Request<ModelProxy> search(String url);

}

ModelService.search(String url) returns valid Model object *or* null if not 
found.

Problem is, if search returns null value, .with(...) part in my client 
request causes NPE on server:

09.04.2013. 10:34:48 
com.google.web.bindery.requestfactory.server.RequestFactoryServlet doPost
SEVERE: Unexpected error
java.lang.NullPointerException
        at 
com.google.web.bindery.requestfactory.server.Resolver.addPathsToResolution(Resolver.java:488)
        at 
com.google.web.bindery.requestfactory.server.Resolver.resolveClientValue(Resolver.java:406)
        at 
com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.processInvocationMessages(SimpleRequestProcessor.java:491)
        at 
com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:233)
        at 
com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:135)
        at 
com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133)
(...)

If I omit ".with(...)" part, request goes ok, giving me null or ModelProxy 
instance (but without paths).

My current workaround is dumb but straightforward - two-phase search: first 
without paths and if return value is not-null then I repeat same request 
with paths. Where is the problem and is there a better workaround?

GWT is 2.5.1

-- 
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+unsubscr...@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to