Re: Unchecked exceptions from server to client

2010-09-16 Thread Etienne Lacazedieu
I managed to d that, but its quite tricky... What we have : - a GWT RPC controller servlet, that handles ALL RPC calls (all calls URL are of the form "MyService.rpc" - it uses "MyService" to resolve a Spring bean, which is used to perform the service (we inject the request and response in the ser

Re: Unchecked exceptions from server to client

2010-09-16 Thread Kasper Hansen
Hi, And thanks for your continuing interest in this subject. >    void getObject() throws RuntimeException; // or our > GwtClientException > } > Problem is gone... Every method from service can throw our > RuntimeExceptions. > > Is it feature or a bug? If you need to declare a RuntimeException,

Re: Unchecked exceptions from server to client

2010-09-16 Thread San0
Hi again, I did more "research" about our way of handling exceptions. Most of our service methods doesnt have any throws declarations but all of them have validation, which is throwing runtime exception (here we are sending field names with errors). "Bad" service: public interface ExceptionModule

Re: Unchecked exceptions from server to client

2010-09-16 Thread Kasper Hansen
> and then mandate all RPC methods to delcare MyAppClientException in the > throws clause. How would I do that ? I hope you do not mean by manually adding MyAppClientException to all my service interfaces... ? On Thu, Sep 16, 2010 at 9:57 AM, Sripathi Krishnan wrote: > You can create a new base

Re: Unchecked exceptions from server to client

2010-09-16 Thread Sripathi Krishnan
You can create a new base exception class MyAppClientException extends RuntimeException, and then mandate all RPC methods to delcare MyAppClientException in the throws clause. If you do that, GWT will automatically write client code for any class that extends MyAppClientException, and you won't ha

Re: Unchecked exceptions from server to client

2010-09-15 Thread Kasper Hansen
> Its a feature, not a defect. You are quite right. > You have to explicitly declare any methods you want to send to the client. > Without this declaration, GWT would have had to create javascript code for > every RuntimeException in the system - and that would certainly lead to code > bloat.

Re: Unchecked exceptions from server to client

2010-09-15 Thread Sripathi Krishnan
> > Does anyone have a reason for why I should not report this a bug in the > issue tracker ? Its a feature, not a defect. You have to *explicitly* declare any methods you want to send to the client. Without this declaration, GWT would have had to create javascript code for every RuntimeException

Re: Unchecked exceptions from server to client

2010-09-15 Thread Kasper Hansen
After closer examination, this solution is not good enough. Examine the stacktrace below; SEVERE: [1284616090213000] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void com.netgaze

Re: Unchecked exceptions from server to client

2010-09-13 Thread San0
Your service probably extends RemoteServiceServlet, which is catching all non declared exceptions. Simple solution is to create your own RemoteServiceServlet implementation with overridden: String processCall(String payload) throws SerializationException Something like this: try { RPCRequest

Unchecked exceptions from server to client

2010-09-13 Thread Kasper Hansen
Hi, I have this; public abstract class CreateException extends RuntimeException implements Serializable { } Notice that I extend from RuntimeException, making it an unchecked exception. Then I have these two; public class DuplicateEmailCreationException extends CreateException { } public clas