I'm facing a problem that i don't how to work around :
I have a servlet with only one service that return an custom
serialzable objet with 2 string on it.
see below the service :
*****************************************************
public class WizardService extends RemoteServiceServlet implements
IWizardService{
public WizardVO getWizardVO(String id) throws Exception {
return new WizardVO();
}
}
*********************************************************
This service is working great (but very useless).
Now, i just add the following line in the method getWizard(..)
Wizard wizard = WizardManager.getInstance().getWizard(id);
This method get an xml file, etc....but nothing else (no client/server
com, etcc)
The method is now :
************************************************************
public WizardVO getWizardVO(String id) throws Exception {
Wizard wizard = WizardManager.getInstance().getWizard(id);
return new WizardVO();
}
Now, see the result :
[WARN] Exception thrown into JavaScript
com.google.gwt.user.client.rpc.SerializationException:
java.lang.NullPointerException/1463492344
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
481)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
248)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
113)
at
org.inventime.web.ui.client.rpc.IWizardService_TypeSerializer.instantiate(transient
source for
org.inventime.web.ui.client.rpc.IWizardService_TypeSerializer:106)
at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:
92)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:
61)
at org.inventime.web.ui.client.rpc.IWizardService_Proxy
$1.onCompletionImpl(transient source for
org.inventime.web.ui.client.rpc.IWizardService_Proxy:59)
at org.inventime.web.ui.client.rpc.IWizardService_Proxy
$1.onCompletionAndCatch(transient source for
org.inventime.web.ui.client.rpc.IWizardService_Proxy:45)
at org.inventime.web.ui.client.rpc.IWizardService_Proxy
$1.onCompletion(transient source for
org.inventime.web.ui.client.rpc.IWizardService_Proxy:39)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:
126)
Why this exception ?? I just add a line that doesn't do anything with
serialization, nor javascript. It's the legacy of my app that i want
to migate.
The servlet is in the package server and i use GWT 1.4 and eclipse.
Can someone please help me understand this issue ?
Thanks a lot,
Thomas
On Jun 22, 6:33 am, "Miguel Méndez" <mmen...@google.com> wrote:
> Hi Masto,
>
> Basically, an NPE is being thrown in your server code and it is being sent
> back to the client but it can't deserialize the NPE.
>
> I think this stems from having your service method specified to throw
> Exception. In this case the proxy code will only be able to handle the GWT
> serializable subtypes. However, the server code thinks that since
> NullPointerException is assignable to Exception it is okay to send it back
> to the client. Hence the SerializationException on the client.
>
> HTH,
>
> --
> Miguel