Problems including Gson in GWT Project

1,242 views
Skip to first unread message

alex

unread,
Jan 13, 2009, 11:43:30 AM1/13/09
to google-gson
Hi there!

I've got a problem using Gson. I am working on a Project using the
GoogleWebToolkit. There a Client-Server Communication is used, and
JSON and Gson to realize this. I included the Gson Library from the
Gson Download File in the Project (maybe it's time to tell that i'm
using Eclipse EE). There i just imported the Gson Library, and in the
Java Build Path and in the Java EE Dependencies. But the Compiler
always gives the error message:

[ERROR] Line 31: No source code is available for type
com.google.gson.Gson; did you forget to inherit a required module?

Can anyone tell me what to do or give some hints where i can find the
answer? The Gson Homepage only tells, that an easy import of the gson
class is enough.

Alex Epshteyn

unread,
Jan 14, 2009, 3:10:11 PM1/14/09
to google-gson
You can't use Gson in your client-side (GWT) code. GWT only allows
you to use a subset of the Java features, and Gson uses more
sophisticated Java capabilities (like reflection) which aren't
supported by GWT.

In general, GWT lets you use 3rd party libraries that were explicitly
designed for GWT.

These are the core Java classes supported by GWT:

http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=RefJreEmulation
Reply all
Reply to author
Forward
0 new messages