RequestFactory not working when upgrade from 2.2 to 2.3

511 views
Skip to first unread message

Joshua Kappon

unread,
May 13, 2011, 7:26:10 PM5/13/11
to Google Web Toolkit
Hi All

I'm trying to upgrade my project to use GWT 2.3
I changed all the imports and xml project and web.xml to point to the
new packages locations.

but RequestFactory calls still don't work.

when running in dev mode I get the following exceptions on run time:

java.lang.NoClassDefFoundError: org/json/JSONException
at
com.google.web.bindery.autobean.shared.impl.StringQuoter.createSplittable(StringQuoter.java:
58)
at
com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.<init>(AbstractAutoBean.java:
71)

this originates from:

Caused by: java.lang.ClassNotFoundException: null
at com.google.gwt.dev.shell.CompilingClassLoader
$MultiParentClassLoader.findClass(CompilingClassLoader.java:365)
at java.lang.ClassLoader.loadClass(Unknown Source)

that is caused by a code call to a

request.doSomething()
or a
request.create(someobject.class)


Did someone else stumble upon something like this?
I'm clueless.





Hilco Wijbenga

unread,
May 14, 2011, 3:43:46 PM5/14/11
to google-we...@googlegroups.com

Yes, I ran into something similar. I fixed the complaint about not
finding JSONException by adding
http://repo1.maven.org/maven2/org/json/json/20090211/json-20090211.jar
to my POM. I find it very strange this should be necessary. We're
supposed to be on the client, in a JavaScript environment after all.
:-) I have not researched this any further so I don't know whether you
need that JSON JAR in the WAR as well or if it's just for dev mode.

The error reporting in RF is not very helpful, unfortunately. The root
cause for me just said something like "Server error: null". It turned
out that the hashCode() methods on two of my DTOs referenced each
other. That obviously led to an infinite loop and apparently to
"Server error: null". :-) (I guess that's how the programming gods
punish people who do not write unit tests. ;-) )

Oh, and don't waste any time on getting GWT/RF's logging to run. It's
completely useless. I had it set to FINEST but it basically only
reported "sent something" and "received something". No mention of what
that something was. Not helpful at all.

I suggest you start adding helpful GWT.log (client side) and
System.out.println (server side) statements and start debugging. It
took me several hours.

Joshua Kappon

unread,
May 15, 2011, 8:42:04 AM5/15/11
to Google Web Toolkit
Thank!

I added the json-20090211.jar to my build path and it solved the
problem!



On May 14, 10:43 pm, Hilco Wijbenga <hilco.wijbe...@gmail.com> wrote:
> On 13 May 2011 16:26, Joshua Kappon <shuky.kap...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi All
>
> > I'm trying to upgrade my project to use GWT 2.3
> > I changed all the imports and xml project and web.xml to point to the
> > new packages locations.
>
> > butRequestFactorycalls still don't work.
>
> > when running in dev mode I get the following exceptions on run time:
>
> > java.lang.NoClassDefFoundError: org/json/JSONException
> >    at
> > com.google.web.bindery.autobean.shared.impl.StringQuoter.createSplittable(StringQuoter.java:
> > 58)
> >    at
> > com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.<init>(AbstractAutoBean.java:
> > 71)
>
> > this originates from:
>
> > Caused by: java.lang.ClassNotFoundException: null
> >    at com.google.gwt.dev.shell.CompilingClassLoader
> > $MultiParentClassLoader.findClass(CompilingClassLoader.java:365)
> >    at java.lang.ClassLoader.loadClass(Unknown Source)
>
> > that is caused by a code call to a
>
> > request.doSomething()
> > or a
> > request.create(someobject.class)
>
> > Did someone else stumble upon something like this?
> > I'm clueless.
>
> Yes, I ran into something similar. I fixed the complaint about not
> finding JSONException by addinghttp://repo1.maven.org/maven2/org/json/json/20090211/json-20090211.jar

icamts

unread,
May 16, 2011, 6:26:20 AM5/16/11
to Google Web Toolkit
Add gwt-servlet-deps.jar to your project. It comes with gwt sdk
distribution.

Cheers,
Luca

Hilco Wijbenga

unread,
May 16, 2011, 12:06:01 PM5/16/11
to google-we...@googlegroups.com
On 16 May 2011 03:26, icamts <ica...@gmail.com> wrote:
> Add gwt-servlet-deps.jar to your project. It comes with gwt sdk
> distribution.

I don't see this JAR on Maven Central.

Thomas Broyer

unread,
May 16, 2011, 12:16:58 PM5/16/11
to google-we...@googlegroups.com
No, with Maven you have to add the javax.validation:validation-api and org.json:json dependencies. gwt-servlet-deps.jar is for people not using Maven: they just have to add this JAR to their classpath (i.e. distribute it in their WAR) without worrying about "third party dependencies".
com.google.gwt:gwt-user and com.google.gwt:gwt-servlet Maven artifacts should have had dependencies on javax.validation:validation-api and org.json:json but they were forgotten before the push to Maven Central; but (apart from validation-api) you'd still have to include the dependencies explicitly as they're optional, only needed if you use RequestFactory, so it's not much of an issue that they were forgotten (validation-api should have been set as <scope>provided</scope> for gwt-user though, as it's now required to compile any GWT project using the Editor framework –other GWT projects should compile but with loads of warnings–).

Note that it's been like this since GWT 2.1 (except validation-api being now required in 2.3 for the Editor framework, on client-side code)

dd

unread,
May 14, 2011, 4:25:13 PM5/14/11
to Google Web Toolkit
hi, experiencing the same problem...

On 14 Mai, 01:26, Joshua Kappon <shuky.kap...@gmail.com> wrote:
> Hi All
>
> I'm trying to upgrade my project to use GWT 2.3
> I changed all the imports and xml project and web.xml to point to the
> new packages locations.
>
> but RequestFactory calls still don't work.
>
> when running in dev mode I get the following exceptions on run time:
>
> java.lang.NoClassDefFoundError: org/json/JSONException
>     at
> com.google.web.bindery.autobean.shared.impl.StringQuoter.createSplittable(S tringQuoter.java:
> 58)
>     at
> com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.<init>(Abstrac tAutoBean.java:

Daniel Dietrich

unread,
May 18, 2011, 3:22:06 AM5/18/11
to google-we...@googlegroups.com
Including gwt-servlet-deps.jar has no effect (for me) other than still receiving the mentioned exception java.lang.NoClassDefFoundError: org/json/JSONException). However, including the latest json classes, like Joshua does, works fine.

 
2011/5/16 Thomas Broyer <t.br...@gmail.com>
No, with Maven you have to add the javax.validation:validation-api and org.json:json dependencies. gwt-servlet-deps.jar is for people not using Maven: they just have to add this JAR to their classpath (i.e. distribute it in their WAR) without worrying about "third party dependencies".
com.google.gwt:gwt-user and com.google.gwt:gwt-servlet Maven artifacts should have had dependencies on javax.validation:validation-api and org.json:json but they were forgotten before the push to Maven Central; but (apart from validation-api) you'd still have to include the dependencies explicitly as they're optional, only needed if you use RequestFactory, so it's not much of an issue that they were forgotten (validation-api should have been set as <scope>provided</scope> for gwt-user though, as it's now required to compile any GWT project using the Editor framework –other GWT projects should compile but with loads of warnings–).

Note that it's been like this since GWT 2.1 (except validation-api being now required in 2.3 for the Editor framework, on client-side code)

--
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.

Alessandro Giannone

unread,
Jul 23, 2011, 4:24:22 PM7/23/11
to Google-We...@googlegroups.com
If you add gwt-servlet-deps.jar to your classpath and also copy it into
/war/WEB-INF/libs it should work properly. The GWT Eclipse Plugin doesn't seem
to copy the file to the libs folder.

Ale

Reply all
Reply to author
Forward
0 new messages