Refactored RequestFactory in 2.3 Fails with org/json/JSONException

154 views
Skip to first unread message

jeff...@gmail.com

unread,
May 13, 2011, 6:52:34 AM5/13/11
to Google Web Toolkit
I just converted my project to the new refactored RequestFactory that
is in the com.google.web.bindery.requestfactory package and it has
started failing with java.lang.NoClassDefFoundError: org/json/
JSONException

I have reproduced the problem using the GWT Sample project, replacing
the RPC handler with a RequestFactory based handler of my own.

Switching my customised GWT Sample back to the version in the
com.google.gwt.requestfactory package (now depreciated) fixes the
problem.

Have I jumped the gun by switching to the
com.google.web.bindery.requestfactory package?
Is there any easy fix for this that I can implement or should I
refector my project back to com.google.gwt.requestfactory version?

David Chandler

unread,
May 14, 2011, 1:06:06 PM5/14/11
to google-we...@googlegroups.com
Hi Jeff,

Looks like you just need the JSON jar in your classpath. It's included in the GWT SDK or you can use this Maven dependency:

<dependency>

<groupId>org.json</groupId>

<artifactId>json</artifactId>

<version>20090211</version>

</dependency>


/dmc


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

jeff...@gmail.com

unread,
May 15, 2011, 12:13:37 PM5/15/11
to Google Web Toolkit
That worked, odd that I wasn't needed before though, something must
have changed in 2.3.

Thanks for the quick and accurate response by the way, I wish the
support I pay suppliers for at work was half as good.

- Jeff

On May 14, 6:06 pm, David Chandler <drfibona...@google.com> wrote:
> Hi Jeff,
>
> Looks like you just need the JSON jar in your classpath. It's included in
> the GWT SDK or you can use this Maven dependency:
>
>     <dependency>
>
>  <groupId>org.json</groupId>
>
>  <artifactId>json</artifactId>
>
>  <version>20090211</version>
>
>  </dependency>
>
> /dmc
>
> On Fri, May 13, 2011 at 3:52 AM, jeffga...@googlemail.com <

Brandon Donnelson

unread,
Oct 6, 2011, 5:41:42 PM10/6/11
to google-we...@googlegroups.com
I had the same problem. I'd like to suggest adding a FAQ section to RequestFactory documentation, with the org/json error and how to solve it, so it could get indexed with the RequestFactory document. And/or a note in "RequestFactory > Putting it all together" add org.json jar... 

I solved it by downloading the sdk, extracted it, and then added the gwt-servlet-deps.jar to the lib directory and then to the build path. 

Brandon Donnelson
Reply all
Reply to author
Forward
0 new messages