gwt exceptions
John Mazzitelli
mazz at redhat.com
Thu Mar 17 17:36:24 UTC 2011
First, if you are writing GWT services in RHQ, you should know that all
*GWTService interface methods should throw RuntimeException and all
*GWTServiceImpl implementation methods should catch throwable and throw
a "scrubbed" runtime exception (this is to avoid serialization errors
when we get things like EJBExceptions - the GWT client doesn't have
javax.ejb classes like that exception class. This is true for all server
side exceptions that are not available in the client, not just EJB
exceptions).
Anyway, I fixed all of our GWTServiceImpls so they now call
org.rhq.enterprise.gui.coregui.server.gwt.AbstractGWTServiceImpl.getExceptionToThrowToClient
and throws the returned exception. That returned exception is scrubbed,
but we also ensure we log the exception and its stack trace in the
server log. The returned exception also has an id number you can
correlate back to the server log - so now when you get an unhelpful
exception in the browser (we show exceptions in the message center
details dialog), our message center will show the exception message that
includes an id number in brackets that you can look for in the server
log to correlate it with the real exception/stack trace. Normally,
server side stack traces are much more helpful in determining the problem.
Here's the bugzilla on this:
https://bugzilla.redhat.com/show_bug.cgi?id=688679
More information about the rhq-devel
mailing list