I already read that it is not possible to run GSON in the GWT client code, but it can be run in the server code .
The last one I'm trying to achieve, but not working. I thought that any class in the com.whatever.server package has access to the entire JRE namespace, including reflection. It seems that this is not so. So, how did all these developers manage to use GSON in the GWT server code? (I'm new to GWT, so the answer can be very simple.)
Thank.
EDIT : My setup is as follows:
- test.gwt.xml contains:
<source path='client'>and<source path='shared'> - the client uses
private final TestServiceAsync testService = GWT.create(TestService.class);and callstestService.testMethod(); - The TestService and TestServiceAsync interfaces are located in the package
- TestServiceImpl implemented in test.server uses
Gson g = new Gson();etc.
The exception is java.lang.NoClassDefFoundError: com / google / gson / Gson. But it seems that it was raised regardless of whether the method contains GSON code or not (it is enough that it contains the GSON import instruction).
Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson
at java.net.URLClassLoader $ 1.run (URLClassLoader.java:200)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass (URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass (ClassLoader.java:307)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass (IsolatedAppClassLoader.java:151)
at java.lang.ClassLoader.loadClass (ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 33 more