No RequestContext for operation [Solved]

620 views
Skip to first unread message

mp31415

unread,
Oct 9, 2011, 10:24:52 AM10/9/11
to Google Web Toolkit
There are already several similar threads but it took me a whole day
to solve this, so I hope this extra piece of info may help to somebody
else in similar situation.

I moved from GWT 2.3 to 2.4. There are no big letters in release
readme or anywhere saying that there are breaking changes since
RequestFactory validation is totally reworked but after some googling
you get the idea. So I quickly ran ValidationTool and created an extra
jar and everything was working again. Note that what is may be obvious
today could be less obvious a month or two ago as the tool
documentation is being constantly corrected.

So I went on with my business, refactored half of the interfaces in
AppRequestFactory and then boom - a dreaded "No RequestContext for
operation" hit me. First I thought I broke some unspoken extra
constraint with RequestFactory or messed up classpath or have wrong
web.xml and so on. I updated all my Eclipse plugins, cleaned up
everything, removed Maven - no luck. I did rerun ValidationTool but
without success. I reverted to a previous version of my code and added
a single simple method to an existing AppRequestFactory interface. And
got the same "No RequestContext for operation".

And only at this point I reread that article about new RequestFactory
validation, added annotation processor (requestfactory-apt.jar) and
voila - everything suddenly works. So if any poor soul out there is in
similar shoes may be this story will help a bit.

On a side note - GWT documentation is terrible and is getting worse
over time. The scope is getting bigger and bigger (Android, App
marketplace and so on) but the quality is dropping with each release.
A year after RequestFactory release any novice must gather million of
pieces about how it works on his own.

And the error message is hardly helpful as well (in the same league as
"the bean is frozen" or "the streams are crossed").

Brandon Donnelson

unread,
Oct 9, 2011, 6:28:26 PM10/9/11
to google-we...@googlegroups.com
Thanks for sharing. I'm not sure I agree with the docs getting worse over time, but I what I do agree with is that the programmers are outpacing the tech writers. I think the the documentation has improved over time. Although, I do agree with the challenge with the request factory setup, the docs do lack some very crucial setup points to get RequestFactory setup and that translates into pain. I to have frittered away time with trying to get it to work. 

But for those who drop by on this via search, here is how I got it to work notes.

Copy the client RequestFactory classes and add them to the annotation processer for the project so the processer will build the classes automatically like datanuclueus enhance does. 

mp31415

unread,
Oct 9, 2011, 7:12:07 PM10/9/11
to Google Web Toolkit
I'm sorry if I was too harsh with my statements. I really appreciate
GWT and it's a wonderful hack. And it's getting better over time. The
complexity of supporting numerous platforms is probably mind-boggling.
The amount of trickery used by the framework is far beyond average
developer level. So I didn't mean to hurt anyone, just was a little
frustrated with the quality of available information.

Brandon Donnelson

unread,
Oct 9, 2011, 7:16:56 PM10/9/11
to google-we...@googlegroups.com
No problem at all. I can conquer with those feelings b/c I've done the same thing :) I'm glad you shared, but I can't vouch for others tho. 

Brandon
Reply all
Reply to author
Forward
0 new messages